Class: Toogle::Query
- Inherits:
-
Object
- Object
- Toogle::Query
- Defined in:
- lib/toogle/query.rb
Constant Summary collapse
- @@all =
[]
Instance Attribute Summary collapse
-
#description ⇒ Object
Returns the value of attribute description.
-
#link ⇒ Object
Returns the value of attribute link.
-
#title ⇒ Object
Returns the value of attribute title.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(title = nil, link = nil, description = nil) ⇒ Query
constructor
A new instance of Query.
Constructor Details
#initialize(title = nil, link = nil, description = nil) ⇒ Query
Returns a new instance of Query.
7 8 9 10 11 12 |
# File 'lib/toogle/query.rb', line 7 def initialize(title=nil, link=nil, description=nil) @title = title @link = link @description = description @@all << self end |
Instance Attribute Details
#description ⇒ Object
Returns the value of attribute description.
5 6 7 |
# File 'lib/toogle/query.rb', line 5 def description @description end |
#link ⇒ Object
Returns the value of attribute link.
5 6 7 |
# File 'lib/toogle/query.rb', line 5 def link @link end |
#title ⇒ Object
Returns the value of attribute title.
5 6 7 |
# File 'lib/toogle/query.rb', line 5 def title @title end |
Class Method Details
.all ⇒ Object
28 29 30 |
# File 'lib/toogle/query.rb', line 28 def self.all @@all end |
.create ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/toogle/query.rb', line 14 def self.create data = Toogle::CLI.new queried_data = data.scraper_gets_user_info i = 0 while i < queried_data[:titles].length this_title = queried_data[:titles][i] this_link = queried_data[:links][i] this_desc = queried_data[:descriptions][i] self.new(this_title, this_link, this_desc) i += 1 end end |