Class: MobileStores::App

Inherits:
Object
  • Object
show all
Defined in:
lib/mobile_stores/app.rb

Class Attribute Summary collapse

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hash = {}) ⇒ App

Returns a new instance of App.



6
7
8
9
10
# File 'lib/mobile_stores/app.rb', line 6

def initialize(hash = {})
  hash.each_pair do |key, value|
    self.send "#{ key }=", value
  end
end

Class Attribute Details

.storeObject

Returns the value of attribute store.



13
14
15
# File 'lib/mobile_stores/app.rb', line 13

def store
  @store
end

Instance Attribute Details

#application_idObject

Returns the value of attribute application_id.



4
5
6
# File 'lib/mobile_stores/app.rb', line 4

def application_id
  @application_id
end

#categoryObject

Returns the value of attribute category.



4
5
6
# File 'lib/mobile_stores/app.rb', line 4

def category
  @category
end

#compatibilityObject

Returns the value of attribute compatibility.



4
5
6
# File 'lib/mobile_stores/app.rb', line 4

def compatibility
  @compatibility
end

#creator_idObject

Returns the value of attribute creator_id.



4
5
6
# File 'lib/mobile_stores/app.rb', line 4

def creator_id
  @creator_id
end

#creator_nameObject

Returns the value of attribute creator_name.



4
5
6
# File 'lib/mobile_stores/app.rb', line 4

def creator_name
  @creator_name
end

#descriptionObject

Returns the value of attribute description.



4
5
6
# File 'lib/mobile_stores/app.rb', line 4

def description
  @description
end

#icon_urlObject

Returns the value of attribute icon_url.



4
5
6
# File 'lib/mobile_stores/app.rb', line 4

def icon_url
  @icon_url
end

#priceObject

Returns the value of attribute price.



4
5
6
# File 'lib/mobile_stores/app.rb', line 4

def price
  @price
end

#ratingObject

Returns the value of attribute rating.



4
5
6
# File 'lib/mobile_stores/app.rb', line 4

def rating
  @rating
end

#screenshot_urlsObject

Returns the value of attribute screenshot_urls.



4
5
6
# File 'lib/mobile_stores/app.rb', line 4

def screenshot_urls
  @screenshot_urls
end

#titleObject

Returns the value of attribute title.



4
5
6
# File 'lib/mobile_stores/app.rb', line 4

def title
  @title
end

#versionObject

Returns the value of attribute version.



4
5
6
# File 'lib/mobile_stores/app.rb', line 4

def version
  @version
end

#view_urlObject

Returns the value of attribute view_url.



4
5
6
# File 'lib/mobile_stores/app.rb', line 4

def view_url
  @view_url
end

Class Method Details

.amazon_marketplaceObject

Selects BlackBerry World Store for further manipulations.



54
55
56
# File 'lib/mobile_stores/app.rb', line 54

def amazon_marketplace
  self.in(AmazonMarketplace)
end

.app_storeObject

Selects Apple AppStore for further manipulations.



34
35
36
# File 'lib/mobile_stores/app.rb', line 34

def app_store
  self.in(AppStore)
end

.blackberry_worldObject

Selects BlackBerry World Store for further manipulations.



49
50
51
# File 'lib/mobile_stores/app.rb', line 49

def blackberry_world
  self.in(BlackBerryWorld)
end

.google_playObject

Selects Google Play Store for further manipulations.



39
40
41
# File 'lib/mobile_stores/app.rb', line 39

def google_play
  self.in(GooglePlay)
end

.in(store) ⇒ Object

Selects the store for further manipulations.

App.in(:app_store)

Raises:

  • (NotImplementedError)


19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/mobile_stores/app.rb', line 19

def in(store)
  store_class = if store.is_a? Symbol
    MobileStores::STORES[store]
  elsif store.is_a? String
    Object.const_get(store) rescue nil
  elsif store.is_a? Class
    store
  end

  raise NotImplementedError, "#{ store } is not implemented yet." if store.nil?

  store_class.new
end

.windows_storeObject

Selects Windows Store for further manipulations.



44
45
46
# File 'lib/mobile_stores/app.rb', line 44

def windows_store
  self.in(WindowsStore)
end