Skip to content

Instantly share code, notes, and snippets.

View rafb43's full-sized avatar

Rafael Bandeira rafb43

View GitHub Profile
class MyClass
def complex_property
@my_complex_property
end
def complex_property= value
#complex logic
@my_complex_property = revamped_value
end
class MyClass
attr :name #this will create a getter for this property
attr_accessor :hair_color #this will create a getter and setter for this property
attr_reader :age, :surname, :birthdate #this will create only getters for all these properties
attr_writer :listening, :talking #this will create only setters for all these properties
end
class MyClass
attr :name #this will create a getter for this property
attr_accessor :hair_color #this will create a getter and setter for this property
end
class MyClass
attr :name #this will create a getter for this property
attr :hair_color, true #the _true_ parameter will enable a setter for this property
end
tradução
--------
Tem conhecimentos que conhecemos. São as coisas que nós sabemos que sabemos.
Tem conhecimentos que não conhecemos. Isso é, tem coisas que nós sabemos que não sabemos.
Mas tem também conhecimentos desconhecidos. Essas são as coisas que não sabemos que não sabemos.
original
--------
There are known knowns. These are things we know that we know.
$ sudo apt-get install ruby1.9.1-dev
$ sudo apt-get install libsqlite3-dev
$ sudo gem install sqlite3-ruby
$ sudo apt-get install ruby1.9.1-dev libsqlite3-ruby libsqlite3-dev
$ sudo gem install sqlite3-ruby
$ grep "string_to_search_in_files" "folder/to/search" -R