Class: WebmaniabrNfeRuby::Models::Order

Inherits:
Object
  • Object
show all
Defined in:
lib/models/order.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Order

Returns a new instance of Order.



7
8
9
10
11
12
13
14
# File 'lib/models/order.rb', line 7

def initialize(options = {})
  @payment    = options[:payment]
  @presence   = options[:presence]
  @ship_type  = options[:ship_type]
  @ship_value = options[:ship_value]
  @discount   = options[:discount]
  @total      = options[:total]
end

Instance Attribute Details

#discountObject

Returns the value of attribute discount.



4
5
6
# File 'lib/models/order.rb', line 4

def discount
  @discount
end

#paymentObject

Returns the value of attribute payment.



4
5
6
# File 'lib/models/order.rb', line 4

def payment
  @payment
end

#presenceObject

Returns the value of attribute presence.



4
5
6
# File 'lib/models/order.rb', line 4

def presence
  @presence
end

#ship_taxObject

Returns the value of attribute ship_tax.



4
5
6
# File 'lib/models/order.rb', line 4

def ship_tax
  @ship_tax
end

#ship_valueObject

Returns the value of attribute ship_value.



4
5
6
# File 'lib/models/order.rb', line 4

def ship_value
  @ship_value
end

#totalObject

Returns the value of attribute total.



4
5
6
# File 'lib/models/order.rb', line 4

def total
  @total
end

Instance Method Details

#to_hashObject



16
17
18
19
20
21
22
23
24
25
# File 'lib/models/order.rb', line 16

def to_hash
  {
    pagamento: @payment,
    presenca: @presence,
    modalidade_frete: @ship_type,
    frete: @ship_value,
    discount: @discount,
    total: @total
  }
end