Class: Retab::FileModel

Inherits:
Types::BaseModel show all
Defined in:
lib/retab/files/file.rb

Constant Summary collapse

HASH_ATTRS =
{
  object: :object,
  id: :id,
  filename: :filename,
  created_at: :created_at,
  updated_at: :updated_at,
  page_count: :page_count
}.freeze

Instance Attribute Summary collapse

Attributes inherited from Types::BaseModel

#last_response

Instance Method Summary collapse

Methods inherited from Types::BaseModel

#inspect, normalize, #to_h, #to_json

Constructor Details

#initialize(json) ⇒ FileModel

Returns a new instance of FileModel.



25
26
27
28
29
30
31
32
33
# File 'lib/retab/files/file.rb', line 25

def initialize(json)
  hash = self.class.normalize(json)
  @object = hash[:object]
  @id = hash[:id]
  @filename = hash[:filename]
  @created_at = hash[:created_at]
  @updated_at = hash[:updated_at]
  @page_count = hash[:page_count]
end

Instance Attribute Details

#created_atObject

Returns the value of attribute created_at.



17
18
19
# File 'lib/retab/files/file.rb', line 17

def created_at
  @created_at
end

#filenameObject

Returns the value of attribute filename.



17
18
19
# File 'lib/retab/files/file.rb', line 17

def filename
  @filename
end

#idObject

Returns the value of attribute id.



17
18
19
# File 'lib/retab/files/file.rb', line 17

def id
  @id
end

#objectObject

Returns the value of attribute object.



17
18
19
# File 'lib/retab/files/file.rb', line 17

def object
  @object
end

#page_countObject

Returns the value of attribute page_count.



17
18
19
# File 'lib/retab/files/file.rb', line 17

def page_count
  @page_count
end

#updated_atObject

Returns the value of attribute updated_at.



17
18
19
# File 'lib/retab/files/file.rb', line 17

def updated_at
  @updated_at
end