Class: ComixScraper::Comic
- Inherits:
-
Object
- Object
- ComixScraper::Comic
- Defined in:
- lib/comix_scraper/comic.rb
Instance Attribute Summary collapse
-
#category ⇒ Object
readonly
Returns the value of attribute category.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#rrp ⇒ Object
readonly
Returns the value of attribute rrp.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(category, id, title, rrp) ⇒ Comic
constructor
A new instance of Comic.
- #to_s ⇒ Object
Constructor Details
#initialize(category, id, title, rrp) ⇒ Comic
Returns a new instance of Comic.
7 8 9 10 11 12 |
# File 'lib/comix_scraper/comic.rb', line 7 def initialize(category, id, title, rrp) @category = category @id = id @title = title @rrp = rrp end |
Instance Attribute Details
#category ⇒ Object (readonly)
Returns the value of attribute category.
5 6 7 |
# File 'lib/comix_scraper/comic.rb', line 5 def category @category end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
5 6 7 |
# File 'lib/comix_scraper/comic.rb', line 5 def id @id end |
#rrp ⇒ Object (readonly)
Returns the value of attribute rrp.
5 6 7 |
# File 'lib/comix_scraper/comic.rb', line 5 def rrp @rrp end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
5 6 7 |
# File 'lib/comix_scraper/comic.rb', line 5 def title @title end |
Instance Method Details
#==(other) ⇒ Object
18 19 20 |
# File 'lib/comix_scraper/comic.rb', line 18 def == (other) other.category == self.category && other.id == self.id && other.title == self.title && other.rrp == self.rrp end |
#to_s ⇒ Object
14 15 16 |
# File 'lib/comix_scraper/comic.rb', line 14 def to_s puts "#{@category} : #{@title}" end |