Class: Retab::Edit
- Inherits:
-
Types::BaseModel
- Object
- Types::BaseModel
- Retab::Edit
- Defined in:
- lib/retab/edits/edit.rb
Constant Summary collapse
- HASH_ATTRS =
{ id: :id, file: :file, model: :model, instructions: :instructions, config: :config, template_id: :template_id, output: :output, usage: :usage, created_at: :created_at }.freeze
Instance Attribute Summary collapse
-
#config ⇒ Object
Returns the value of attribute config.
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#file ⇒ Object
Returns the value of attribute file.
-
#id ⇒ Object
Returns the value of attribute id.
-
#instructions ⇒ Object
Returns the value of attribute instructions.
-
#model ⇒ Object
Returns the value of attribute model.
-
#output ⇒ Object
Returns the value of attribute output.
-
#template_id ⇒ Object
Returns the value of attribute template_id.
-
#usage ⇒ Object
Returns the value of attribute usage.
Attributes inherited from Types::BaseModel
Instance Method Summary collapse
-
#initialize(json) ⇒ Edit
constructor
A new instance of Edit.
Methods inherited from Types::BaseModel
#inspect, normalize, #to_h, #to_json
Constructor Details
#initialize(json) ⇒ Edit
Returns a new instance of Edit.
31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/retab/edits/edit.rb', line 31 def initialize(json) hash = self.class.normalize(json) @id = hash[:id] @file = hash[:file] ? Retab::FileRef.new(hash[:file]) : nil @model = hash[:model] @instructions = hash[:instructions] @config = hash[:config] ? Retab::EditConfig.new(hash[:config]) : nil @template_id = hash[:template_id] @output = hash[:output] ? Retab::EditResult.new(hash[:output]) : nil @usage = hash[:usage] ? Retab::RetabUsage.new(hash[:usage]) : nil @created_at = hash[:created_at] end |
Instance Attribute Details
#config ⇒ Object
Returns the value of attribute config.
20 21 22 |
# File 'lib/retab/edits/edit.rb', line 20 def config @config end |
#created_at ⇒ Object
Returns the value of attribute created_at.
20 21 22 |
# File 'lib/retab/edits/edit.rb', line 20 def created_at @created_at end |
#file ⇒ Object
Returns the value of attribute file.
20 21 22 |
# File 'lib/retab/edits/edit.rb', line 20 def file @file end |
#id ⇒ Object
Returns the value of attribute id.
20 21 22 |
# File 'lib/retab/edits/edit.rb', line 20 def id @id end |
#instructions ⇒ Object
Returns the value of attribute instructions.
20 21 22 |
# File 'lib/retab/edits/edit.rb', line 20 def instructions @instructions end |
#model ⇒ Object
Returns the value of attribute model.
20 21 22 |
# File 'lib/retab/edits/edit.rb', line 20 def model @model end |
#output ⇒ Object
Returns the value of attribute output.
20 21 22 |
# File 'lib/retab/edits/edit.rb', line 20 def output @output end |
#template_id ⇒ Object
Returns the value of attribute template_id.
20 21 22 |
# File 'lib/retab/edits/edit.rb', line 20 def template_id @template_id end |
#usage ⇒ Object
Returns the value of attribute usage.
20 21 22 |
# File 'lib/retab/edits/edit.rb', line 20 def usage @usage end |