Class: Peekapp::App
- Inherits:
-
Object
- Object
- Peekapp::App
- Defined in:
- lib/peekapp/apps.rb
Instance Attribute Summary collapse
-
#_ratings ⇒ Object
Returns the value of attribute _ratings.
-
#_reviews ⇒ Object
Returns the value of attribute _reviews.
Instance Method Summary collapse
-
#id ⇒ Object
}}}.
-
#initialize(data) ⇒ App
constructor
{{{.
-
#method_missing(method) ⇒ Object
}}}.
-
#ratings(options = {}) ⇒ Object
}}}.
-
#reviews(options = {}) ⇒ Object
}}}.
Constructor Details
#initialize(data) ⇒ App
{{{
22 23 24 |
# File 'lib/peekapp/apps.rb', line 22 def initialize data # {{{ @data = data end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method) ⇒ Object
}}}
30 31 32 |
# File 'lib/peekapp/apps.rb', line 30 def method_missing method # {{{ @data[method.to_s] end |
Instance Attribute Details
#_ratings ⇒ Object
Returns the value of attribute _ratings.
20 21 22 |
# File 'lib/peekapp/apps.rb', line 20 def end |
#_reviews ⇒ Object
Returns the value of attribute _reviews.
20 21 22 |
# File 'lib/peekapp/apps.rb', line 20 def _reviews @_reviews end |
Instance Method Details
#id ⇒ Object
}}}
26 27 28 |
# File 'lib/peekapp/apps.rb', line 26 def id # {{{ @data["trackId"] end |
#ratings(options = {}) ⇒ Object
}}}
34 35 36 37 |
# File 'lib/peekapp/apps.rb', line 34 def ={} # {{{ self. = Peekapp::Ratings.from_app self.id, ["143455-5,12"], if self..nil? or [:force_refresh] self. end |
#reviews(options = {}) ⇒ Object
}}}
39 40 41 42 |
# File 'lib/peekapp/apps.rb', line 39 def reviews ={} # {{{ self._reviews = Peekapp::Reviews.from_app self.id, ["143455-5,12"], if self._reviews.nil? or [:force_refresh] self._reviews end |