Class: Peekapp::Rating

Inherits:
Object
  • Object
show all
Defined in:
lib/peekapp/ratings.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#dataObject

Returns the value of attribute data.



48
49
50
# File 'lib/peekapp/ratings.rb', line 48

def data
  @data
end

Instance Method Details

#idObject

}}}



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