Class: OmniScrapper::Result

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

Defined Under Namespace

Classes: Signature

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(scrapper_name) ⇒ Result

Returns a new instance of Result.



5
6
7
8
# File 'lib/omni_scrapper/result.rb', line 5

def initialize(scrapper_name)
  self.scrapper_name = scrapper_name
  self.timestamp = Time.now
end

Instance Attribute Details

#checksumObject

Returns the value of attribute checksum.



3
4
5
# File 'lib/omni_scrapper/result.rb', line 3

def checksum
  @checksum
end

#dataObject

Returns the value of attribute data.



3
4
5
# File 'lib/omni_scrapper/result.rb', line 3

def data
  @data
end

#scrapper_nameObject

Returns the value of attribute scrapper_name.



3
4
5
# File 'lib/omni_scrapper/result.rb', line 3

def scrapper_name
  @scrapper_name
end

#timestampObject

Returns the value of attribute timestamp.



3
4
5
# File 'lib/omni_scrapper/result.rb', line 3

def timestamp
  @timestamp
end

Instance Method Details

#build(data) ⇒ Object



10
11
12
13
# File 'lib/omni_scrapper/result.rb', line 10

def build(data)
  self.data = data
  self.checksum = Signature.new(data).calculate
end