Class: OrangeData::CorrectionResult

Inherits:
PayloadContent show all
Defined in:
lib/orange_data/receipt.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from PayloadContent

#==, #as_json, #assign_attributes, #attributes, #to_hash, #to_json

Constructor Details

#initialize(payload) ⇒ CorrectionResult

Returns a new instance of CorrectionResult.



250
251
252
253
# File 'lib/orange_data/receipt.rb', line 250

def initialize(payload)
  super(payload || {})
  @content = CorrectionContent.new(@payload["content"] || {})
end

Instance Attribute Details

#contentObject (readonly)

Returns the value of attribute content.



262
263
264
# File 'lib/orange_data/receipt.rb', line 262

def content
  @content
end

Class Method Details

.from_hash(hash) ⇒ Object

Raises:

  • (ArgumentError)


255
256
257
258
259
260
# File 'lib/orange_data/receipt.rb', line 255

def self.from_hash(hash)
  return if hash.nil?
  raise ArgumentError, 'Expect hash here' unless hash.is_a?(Hash)

  new(hash)
end