Class: Retab::FileModel
- Inherits:
-
Types::BaseModel
- Object
- Types::BaseModel
- Retab::FileModel
- Defined in:
- lib/retab/files/file.rb
Constant Summary collapse
- HASH_ATTRS =
{ object: :object, id: :id, filename: :filename, mime_type: :mime_type, created_at: :created_at, updated_at: :updated_at, page_count: :page_count }.freeze
Instance Attribute Summary collapse
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#filename ⇒ Object
Returns the value of attribute filename.
-
#id ⇒ Object
Returns the value of attribute id.
-
#mime_type ⇒ Object
Returns the value of attribute mime_type.
-
#object ⇒ Object
Returns the value of attribute object.
-
#page_count ⇒ Object
Returns the value of attribute page_count.
-
#updated_at ⇒ Object
Returns the value of attribute updated_at.
Attributes inherited from Types::BaseModel
Instance Method Summary collapse
-
#initialize(json) ⇒ FileModel
constructor
A new instance of FileModel.
Methods inherited from Types::BaseModel
deep_symbolize, #inspect, normalize, #to_h, #to_json
Constructor Details
#initialize(json) ⇒ FileModel
Returns a new instance of FileModel.
28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/retab/files/file.rb', line 28 def initialize(json) super() hash = self.class.normalize(json) @object = hash[:object] @id = hash[:id] @filename = hash[:filename] @mime_type = hash[:mime_type] @created_at = hash[:created_at] @updated_at = hash[:updated_at] @page_count = hash[:page_count] end |
Instance Attribute Details
#created_at ⇒ Object
Returns the value of attribute created_at.
18 19 20 |
# File 'lib/retab/files/file.rb', line 18 def created_at @created_at end |
#filename ⇒ Object
Returns the value of attribute filename.
18 19 20 |
# File 'lib/retab/files/file.rb', line 18 def filename @filename end |
#id ⇒ Object
Returns the value of attribute id.
18 19 20 |
# File 'lib/retab/files/file.rb', line 18 def id @id end |
#mime_type ⇒ Object
Returns the value of attribute mime_type.
18 19 20 |
# File 'lib/retab/files/file.rb', line 18 def mime_type @mime_type end |
#object ⇒ Object
Returns the value of attribute object.
18 19 20 |
# File 'lib/retab/files/file.rb', line 18 def object @object end |
#page_count ⇒ Object
Returns the value of attribute page_count.
18 19 20 |
# File 'lib/retab/files/file.rb', line 18 def page_count @page_count end |
#updated_at ⇒ Object
Returns the value of attribute updated_at.
18 19 20 |
# File 'lib/retab/files/file.rb', line 18 def updated_at @updated_at end |