Class: Lara::Models::Document

Inherits:
Base
  • Object
show all
Defined in:
lib/lara/models/documents.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

parse_time

Constructor Details

#initialize(id:, status:, filename:, target: nil, source: nil, created_at: nil, updated_at: nil, options: nil, translated_chars: nil, total_chars: nil, error_reason: nil) ⇒ Document

Returns a new instance of Document.



46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/lara/models/documents.rb', line 46

def initialize(id:, status:, filename:, target: nil, source: nil, created_at: nil, updated_at: nil,
               options: nil, translated_chars: nil, total_chars: nil, error_reason: nil)
  super()
  @id = id
  @status = status
  @source = source
  @target = target
  @filename = filename
  @created_at = Base.parse_time(created_at)
  @updated_at = Base.parse_time(updated_at)
  @options = options
  @translated_chars = translated_chars&.to_i
  @total_chars = total_chars&.to_i
  @error_reason = error_reason
end

Instance Attribute Details

#created_atObject (readonly)

Returns the value of attribute created_at.



43
44
45
# File 'lib/lara/models/documents.rb', line 43

def created_at
  @created_at
end

#error_reasonObject (readonly)

Returns the value of attribute error_reason.



43
44
45
# File 'lib/lara/models/documents.rb', line 43

def error_reason
  @error_reason
end

#filenameObject (readonly)

Returns the value of attribute filename.



43
44
45
# File 'lib/lara/models/documents.rb', line 43

def filename
  @filename
end

#idObject (readonly)

Returns the value of attribute id.



43
44
45
# File 'lib/lara/models/documents.rb', line 43

def id
  @id
end

#optionsObject (readonly)

Returns the value of attribute options.



43
44
45
# File 'lib/lara/models/documents.rb', line 43

def options
  @options
end

#sourceObject (readonly)

Returns the value of attribute source.



43
44
45
# File 'lib/lara/models/documents.rb', line 43

def source
  @source
end

#statusObject (readonly)

Returns the value of attribute status.



43
44
45
# File 'lib/lara/models/documents.rb', line 43

def status
  @status
end

#targetObject (readonly)

Returns the value of attribute target.



43
44
45
# File 'lib/lara/models/documents.rb', line 43

def target
  @target
end

#total_charsObject (readonly)

Returns the value of attribute total_chars.



43
44
45
# File 'lib/lara/models/documents.rb', line 43

def total_chars
  @total_chars
end

#translated_charsObject (readonly)

Returns the value of attribute translated_chars.



43
44
45
# File 'lib/lara/models/documents.rb', line 43

def translated_chars
  @translated_chars
end

#updated_atObject (readonly)

Returns the value of attribute updated_at.



43
44
45
# File 'lib/lara/models/documents.rb', line 43

def updated_at
  @updated_at
end