Class: Rooftop::Author
- Inherits:
-
Object
- Object
- Rooftop::Author
- Defined in:
- lib/rooftop/models/author.rb
Instance Method Summary collapse
- #==(other) ⇒ Object
- #id ⇒ Object
-
#initialize(args) ⇒ Author
constructor
A new instance of Author.
Constructor Details
#initialize(args) ⇒ Author
Returns a new instance of Author.
3 4 5 6 7 8 |
# File 'lib/rooftop/models/author.rb', line 3 def initialize(args) args.each do |k,v| instance_variable_set("@#{k}", v) self.class.send(:attr_accessor, k) end end |
Instance Method Details
#==(other) ⇒ Object
14 15 16 |
# File 'lib/rooftop/models/author.rb', line 14 def ==(other) other.respond_to?(:id) && other.id == id end |
#id ⇒ Object
10 11 12 |
# File 'lib/rooftop/models/author.rb', line 10 def id self.instance_variable_get(:"@ID") end |