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

#==, #assign_attributes, #to_hash, #to_json

Constructor Details

#initialize(payload) ⇒ CorrectionResult

Returns a new instance of CorrectionResult.



223
224
225
226
# File 'lib/orange_data/receipt.rb', line 223

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

Instance Attribute Details

#contentObject (readonly)

Returns the value of attribute content.



233
234
235
# File 'lib/orange_data/receipt.rb', line 233

def content
  @content
end

Class Method Details

.from_hash(hash) ⇒ Object

Raises:

  • (ArgumentError)


228
229
230
231
# File 'lib/orange_data/receipt.rb', line 228

def self.from_hash(hash)
  raise ArgumentError, 'Expect hash here' unless hash.is_a?(Hash)
  new(hash)
end