Class: Retab::FileBlueprint
- Inherits:
-
Types::BaseModel
- Object
- Types::BaseModel
- Retab::FileBlueprint
- Defined in:
- lib/retab/files/file_blueprint.rb
Constant Summary collapse
- HASH_ATTRS =
{ object: :object, id: :id, file: :file, mode: :mode, intent: :intent, output: :output, status: :status, error: :error, created_at: :created_at, started_at: :started_at, completed_at: :completed_at }.freeze
Instance Attribute Summary collapse
-
#completed_at ⇒ Object
Returns the value of attribute completed_at.
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#error ⇒ Object
Returns the value of attribute error.
-
#file ⇒ Object
Returns the value of attribute file.
-
#id ⇒ Object
Returns the value of attribute id.
-
#intent ⇒ Object
Returns the value of attribute intent.
-
#mode ⇒ Object
Returns the value of attribute mode.
-
#object ⇒ Object
Returns the value of attribute object.
-
#output ⇒ Object
Returns the value of attribute output.
-
#started_at ⇒ Object
Returns the value of attribute started_at.
-
#status ⇒ Object
Returns the value of attribute status.
Attributes inherited from Types::BaseModel
Instance Method Summary collapse
-
#initialize(json) ⇒ FileBlueprint
constructor
A new instance of FileBlueprint.
Methods inherited from Types::BaseModel
deep_symbolize, #inspect, normalize, #to_h, #to_json
Constructor Details
#initialize(json) ⇒ FileBlueprint
Returns a new instance of FileBlueprint.
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/retab/files/file_blueprint.rb', line 36 def initialize(json) super() hash = self.class.normalize(json) @object = hash[:object].nil? ? "file.blueprint" : hash[:object] @id = hash[:id] @file = hash[:file] ? Retab::FileRef.new(hash[:file]) : nil @mode = hash[:mode] @intent = hash[:intent] @output = hash[:output] || {} @status = hash[:status].nil? ? "pending" : hash[:status] @error = hash[:error] ? Retab::PrimitiveError.new(hash[:error]) : nil @created_at = hash[:created_at] @started_at = hash[:started_at] @completed_at = hash[:completed_at] end |
Instance Attribute Details
#completed_at ⇒ Object
Returns the value of attribute completed_at.
22 23 24 |
# File 'lib/retab/files/file_blueprint.rb', line 22 def completed_at @completed_at end |
#created_at ⇒ Object
Returns the value of attribute created_at.
22 23 24 |
# File 'lib/retab/files/file_blueprint.rb', line 22 def created_at @created_at end |
#error ⇒ Object
Returns the value of attribute error.
22 23 24 |
# File 'lib/retab/files/file_blueprint.rb', line 22 def error @error end |
#file ⇒ Object
Returns the value of attribute file.
22 23 24 |
# File 'lib/retab/files/file_blueprint.rb', line 22 def file @file end |
#id ⇒ Object
Returns the value of attribute id.
22 23 24 |
# File 'lib/retab/files/file_blueprint.rb', line 22 def id @id end |
#intent ⇒ Object
Returns the value of attribute intent.
22 23 24 |
# File 'lib/retab/files/file_blueprint.rb', line 22 def intent @intent end |
#mode ⇒ Object
Returns the value of attribute mode.
22 23 24 |
# File 'lib/retab/files/file_blueprint.rb', line 22 def mode @mode end |
#object ⇒ Object
Returns the value of attribute object.
22 23 24 |
# File 'lib/retab/files/file_blueprint.rb', line 22 def object @object end |
#output ⇒ Object
Returns the value of attribute output.
22 23 24 |
# File 'lib/retab/files/file_blueprint.rb', line 22 def output @output end |
#started_at ⇒ Object
Returns the value of attribute started_at.
22 23 24 |
# File 'lib/retab/files/file_blueprint.rb', line 22 def started_at @started_at end |
#status ⇒ Object
Returns the value of attribute status.
22 23 24 |
# File 'lib/retab/files/file_blueprint.rb', line 22 def status @status end |