Module: MobileStores::MobileStore::InstanceMethods
- Included in:
- MobileStores::MobileStore
- Defined in:
- lib/mobile_stores/mobile_store.rb
Instance Attribute Summary collapse
-
#country(country = nil) ⇒ Object
Selects store corresponding to country or returns selected country, if arguments is not specified App.in(:app_store).country(:us).find(“12345”) # returns
Appobject.
Instance Method Summary collapse
-
#exists?(id) ⇒ Boolean
Returns true if app exists in store searching by ID, otherwise returns false.
-
#find(id) ⇒ Object
Finds app in store by ID.
-
#find!(id) ⇒ Object
Finds app in store by ID.
- #initialize ⇒ Object
-
#search(query, count = nil) ⇒ Object
Searches apps in store by query.
Instance Attribute Details
Instance Method Details
#exists?(id) ⇒ Boolean
Returns true if app exists in store searching by ID, otherwise returns false
60 61 62 |
# File 'lib/mobile_stores/mobile_store.rb', line 60 def exists?(id) not find(id).nil? end |
#find(id) ⇒ Object
37 38 39 |
# File 'lib/mobile_stores/mobile_store.rb', line 37 def find(id) find!(id) rescue nil end |
#find!(id) ⇒ Object
46 47 48 |
# File 'lib/mobile_stores/mobile_store.rb', line 46 def find!(id) self.class.find_app(id, country) end |
#initialize ⇒ Object
12 13 14 15 16 |
# File 'lib/mobile_stores/mobile_store.rb', line 12 def initialize # set country to United States as default @country = Country.new(:us) super end |