Class: Retab::EditRequest

Inherits:
Types::BaseModel show all
Defined in:
lib/retab/edits/edit_request.rb

Constant Summary collapse

HASH_ATTRS =
{
  instructions: :instructions,
  document: :document,
  template_id: :template_id,
  model: :model,
  config: :config,
  bust_cache: :bust_cache
}.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) ⇒ EditRequest

Returns a new instance of EditRequest.



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

def initialize(json)
  hash = self.class.normalize(json)
  @instructions = hash[:instructions]
  @document = hash[:document] ? Retab::MimeData.new(hash[:document]) : nil
  @template_id = hash[:template_id]
  @model = hash[:model]
  @config = hash[:config] ? Retab::EditConfig.new(hash[:config]) : nil
  @bust_cache = hash[:bust_cache]
end

Instance Attribute Details

#bust_cacheObject

Returns the value of attribute bust_cache.



17
18
19
# File 'lib/retab/edits/edit_request.rb', line 17

def bust_cache
  @bust_cache
end

#configObject

Returns the value of attribute config.



17
18
19
# File 'lib/retab/edits/edit_request.rb', line 17

def config
  @config
end

#documentObject

Returns the value of attribute document.



17
18
19
# File 'lib/retab/edits/edit_request.rb', line 17

def document
  @document
end

#instructionsObject

Returns the value of attribute instructions.



17
18
19
# File 'lib/retab/edits/edit_request.rb', line 17

def instructions
  @instructions
end

#modelObject

Returns the value of attribute model.



17
18
19
# File 'lib/retab/edits/edit_request.rb', line 17

def model
  @model
end

#template_idObject

Returns the value of attribute template_id.



17
18
19
# File 'lib/retab/edits/edit_request.rb', line 17

def template_id
  @template_id
end