Class: Amzwish::Book
- Inherits:
-
Object
- Object
- Amzwish::Book
- Defined in:
- lib/amzwish/book.rb
Instance Attribute Summary collapse
-
#asin ⇒ Object
Returns the value of attribute asin.
-
#title ⇒ Object
Returns the value of attribute title.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(title, asin) ⇒ Book
constructor
A new instance of Book.
- #to_s ⇒ Object
Constructor Details
#initialize(title, asin) ⇒ Book
Returns a new instance of Book.
4 5 6 7 |
# File 'lib/amzwish/book.rb', line 4 def initialize(title, asin) @title = title @asin = asin end |
Instance Attribute Details
#asin ⇒ Object
Returns the value of attribute asin.
3 4 5 |
# File 'lib/amzwish/book.rb', line 3 def asin @asin end |
#title ⇒ Object
Returns the value of attribute title.
3 4 5 |
# File 'lib/amzwish/book.rb', line 3 def title @title end |
Instance Method Details
#==(other) ⇒ Object
9 10 11 12 |
# File 'lib/amzwish/book.rb', line 9 def ==(other) other.respond_to?(:asin) && self.asin == other.asin end |
#to_s ⇒ Object
14 15 16 |
# File 'lib/amzwish/book.rb', line 14 def to_s "#{title}(#{asin})" end |