Class: DailyTrending::App

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

Constant Summary collapse

@@all =
[]

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#app_urlObject

Returns the value of attribute app_url.



2
3
4
# File 'lib/daily_trending/app.rb', line 2

def app_url
  @app_url
end

#con_ratingObject

Returns the value of attribute con_rating.



2
3
4
# File 'lib/daily_trending/app.rb', line 2

def con_rating
  @con_rating
end

#descriptionObject

Returns the value of attribute description.



2
3
4
# File 'lib/daily_trending/app.rb', line 2

def description
  @description
end

#devObject

Returns the value of attribute dev.



2
3
4
# File 'lib/daily_trending/app.rb', line 2

def dev
  @dev
end

#dev_urlObject

Returns the value of attribute dev_url.



2
3
4
# File 'lib/daily_trending/app.rb', line 2

def dev_url
  @dev_url
end

#genreObject

Returns the value of attribute genre.



2
3
4
# File 'lib/daily_trending/app.rb', line 2

def genre
  @genre
end

#priceObject

Returns the value of attribute price.



2
3
4
# File 'lib/daily_trending/app.rb', line 2

def price
  @price
end

#rate_cntObject

Returns the value of attribute rate_cnt.



2
3
4
# File 'lib/daily_trending/app.rb', line 2

def rate_cnt
  @rate_cnt
end

#ratingObject

Returns the value of attribute rating.



2
3
4
# File 'lib/daily_trending/app.rb', line 2

def rating
  @rating
end

#titleObject

Returns the value of attribute title.



2
3
4
# File 'lib/daily_trending/app.rb', line 2

def title
  @title
end

Class Method Details

.allObject



6
7
8
# File 'lib/daily_trending/app.rb', line 6

def self.all
  @@all
end

.find(input) ⇒ Object



11
12
13
# File 'lib/daily_trending/app.rb', line 11

def self.find(input)
  @@all[input.to_i-1]
end

Instance Method Details

#exist?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/daily_trending/app.rb', line 16

def exist?
  self.class.all.any?{|ap| ap.title == self.title}
end

#open_in_browserObject



25
26
27
# File 'lib/daily_trending/app.rb', line 25

def open_in_browser
  system("open '#{app_url}'")
end

#saveObject



21
22
23
# File 'lib/daily_trending/app.rb', line 21

def save
  @@all << self
end