Class: Toptranslation::Resource::Quote

Inherits:
Object
  • Object
show all
Defined in:
lib/toptranslation/resource/quote.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(connection, options = {}) ⇒ Quote

Returns a new instance of Quote.



6
7
8
9
10
# File 'lib/toptranslation/resource/quote.rb', line 6

def initialize(connection, options = {})
  @connection = connection
  @options = options
  update_from_response(options)
end

Instance Attribute Details

#created_atObject (readonly)

Returns the value of attribute created_at.



3
4
5
# File 'lib/toptranslation/resource/quote.rb', line 3

def created_at
  @created_at
end

#estimated_delivery_dateObject (readonly)

Returns the value of attribute estimated_delivery_date.



3
4
5
# File 'lib/toptranslation/resource/quote.rb', line 3

def estimated_delivery_date
  @estimated_delivery_date
end

#identifierObject (readonly)

Returns the value of attribute identifier.



3
4
5
# File 'lib/toptranslation/resource/quote.rb', line 3

def identifier
  @identifier
end

#productObject (readonly)

Returns the value of attribute product.



3
4
5
# File 'lib/toptranslation/resource/quote.rb', line 3

def product
  @product
end

#stateObject (readonly)

Returns the value of attribute state.



3
4
5
# File 'lib/toptranslation/resource/quote.rb', line 3

def state
  @state
end

#valueObject (readonly)

Returns the value of attribute value.



3
4
5
# File 'lib/toptranslation/resource/quote.rb', line 3

def value
  @value
end

Instance Method Details

#acceptObject



12
13
14
# File 'lib/toptranslation/resource/quote.rb', line 12

def accept
  @connection.patch("/quotes/#{identifier}/accept", version: 2)
end

#reject(reason = nil) ⇒ Object



16
17
18
# File 'lib/toptranslation/resource/quote.rb', line 16

def reject(reason = nil)
  @connection.patch("/quotes/#{identifier}/reject", reason: reason, version: 2)
end