January 17, 2010 Ruby
January 17, 2010 Ruby
Of course not. There is a lot of interesting stuff in Ruby. But at least I tried that quick list here:
http://www.ruby-lang.org/en/documentation/quickstart/
To print something you just need to write puts keyword.
You could calculate online:
Lets define method to calculate price of one of the Dell notebooks here in Ukraine if price is in Dollars, but you want to know how much it is in Hryvnas.
Lets use it:
But Ruby is object-orient language. So here is my Exchanger class and I want to initialize it with exchanging rate:
@rate is field of that class. Don’t you see that syntax very sweet? I see.
Next, we will create instance of our class with a bit lower rate. And use that instance of class:
“In Ruby, you can open a class up again and modify it. The changes will be present in any new objects you create and even available in existing objects of that class. “
That is amazing as per me, because you could just write code after you have declaration of your class and change intent of it.
You need to try play with Ruby, that is very sweet language!
Markdown | Result |
---|---|
*text* | text |
**text** | text |
***text*** | text |
`code` | code |
~~~ more code ~~~~ |
more code |
[Link](https://www.example.com) | Link |
* Listitem |
|
> Quote | Quote |
as for now, nothing too special about ruby
javascript can do the same :)
P.S. What do you use to highlight you code blocks?
Hey, I know that nothing too special, but that stuff is new for me and looks interesting.
For highlighting I'm using this online:
http://quickhighlighter.com/
And one good man recommended this add-on to VS to highlight C# code:
http://copysourceashtml.codeplex.com/
nothing special — so why give this samples if they do not convince anybody?
thanks for highlighting utilities, I'll try them when I'll need to post some code
Andrii, I'm learner… I posted this only because I heard a lot about Ruby, but did not know what is it. Now I have some basic understanding. Posting helps me learn and remember things. Also I will have place where to go if will need something on Ruby.
And remember, blogger is for me as well as for others.
ok, no problem with, don't be angry ;)
Hey, I'm not angry.
BTW: here are funny angry comics: http://rlacovara.blogspot.com/search/label/Angry-Coders
Enjoy.
ok, be happy :-D and thanks for comics