Class: ListingsParser

Inherits:
Object
  • Object
show all
Defined in:
app/parsers/listings_parser.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(game) ⇒ ListingsParser


4
5
6
# File 'app/parsers/listings_parser.rb', line 4

def initialize(game)
  @game = game
end

Instance Attribute Details

#gameObject (readonly)

Returns the value of attribute game


2
3
4
# File 'app/parsers/listings_parser.rb', line 2

def game
  @game
end

Instance Method Details

#parseObject


8
9
10
11
12
13
# File 'app/parsers/listings_parser.rb', line 8

def parse
  if response_successful?
    listings.each { |listing| game_processor(listing_parser(listing)).process }
    games_repository.update(game.id)
  end
end