Class: GoogleBase::Item

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ae) ⇒ Item

Constructs an item from



65
66
67
68
69
70
71
# File 'lib/allyourbase.rb', line 65

def initialize(ae)
  @author      = ae.authors.first.name
  @title       = ae.title
  @description = ae.content
  @image_url   = ae[GOOGLENS,"image_link"].first
  @price       = ae[GOOGLENS,"price"].first.split(/\s+/).first.to_f
end

Instance Attribute Details

#authorObject

Returns the value of attribute author.



59
60
61
# File 'lib/allyourbase.rb', line 59

def author
  @author
end

#descriptionObject

Returns the value of attribute description.



59
60
61
# File 'lib/allyourbase.rb', line 59

def description
  @description
end

#image_urlObject

Returns the value of attribute image_url.



59
60
61
# File 'lib/allyourbase.rb', line 59

def image_url
  @image_url
end

#priceObject

Returns the value of attribute price.



59
60
61
# File 'lib/allyourbase.rb', line 59

def price
  @price
end

#titleObject

Returns the value of attribute title.



59
60
61
# File 'lib/allyourbase.rb', line 59

def title
  @title
end