Class: Peekapp::Rating
- Inherits:
-
Object
- Object
- Peekapp::Rating
- Defined in:
- lib/peekapp/ratings.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
Instance Method Summary collapse
-
#id ⇒ Object
}}}.
-
#initialize(data) ⇒ Rating
constructor
{{{.
-
#method_missing(method) ⇒ Object
}}}.
-
#set(args) ⇒ Object
}}}.
Constructor Details
#initialize(data) ⇒ Rating
{{{
50 51 52 |
# File 'lib/peekapp/ratings.rb', line 50 def initialize data # {{{ @data = data end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method) ⇒ Object
}}}
62 63 64 |
# File 'lib/peekapp/ratings.rb', line 62 def method_missing method # {{{ @data[method.to_sym] end |
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
48 49 50 |
# File 'lib/peekapp/ratings.rb', line 48 def data @data end |
Instance Method Details
#id ⇒ Object
}}}
54 55 56 |
# File 'lib/peekapp/ratings.rb', line 54 def id # {{{ @data[:id] end |
#set(args) ⇒ Object
}}}
58 59 60 |
# File 'lib/peekapp/ratings.rb', line 58 def set args # {{{ @data.merge!({args[:key] => args[:value]}) end |