Class: Peekapp::App

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#_ratingsObject

Returns the value of attribute _ratings.



20
21
22
# File 'lib/peekapp/apps.rb', line 20

def _ratings
  @_ratings
end

#_reviewsObject

Returns the value of attribute _reviews.



20
21
22
# File 'lib/peekapp/apps.rb', line 20

def _reviews
  @_reviews
end

Instance Method Details

#idObject

}}}



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 ratings options={} # {{{
  self._ratings = Peekapp::Ratings.from_app self.id, ["143455-5,12"], options if self._ratings.nil? or options[:force_refresh]
  self._ratings
end

#reviews(options = {}) ⇒ Object

}}}



39
40
41
42
# File 'lib/peekapp/apps.rb', line 39

def reviews options={} # {{{
  self._reviews = Peekapp::Reviews.from_app self.id, ["143455-5,12"], options if self._reviews.nil? or options[:force_refresh]
  self._reviews
end