Class: ComixScraper::Comic

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#categoryObject (readonly)

Returns the value of attribute category.



5
6
7
# File 'lib/comix_scraper/comic.rb', line 5

def category
  @category
end

#idObject (readonly)

Returns the value of attribute id.



5
6
7
# File 'lib/comix_scraper/comic.rb', line 5

def id
  @id
end

#rrpObject (readonly)

Returns the value of attribute rrp.



5
6
7
# File 'lib/comix_scraper/comic.rb', line 5

def rrp
  @rrp
end

#titleObject (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_sObject



14
15
16
# File 'lib/comix_scraper/comic.rb', line 14

def to_s
  puts "#{@category} : #{@title}"
end