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
15
16
17
# 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]
  @other_costs            = options[:other_costs]
  @fisco_informations     = options[:fisco_informations]
  @complement_information = options[:complement_information]
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



19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/models/order.rb', line 19

def to_hash
  {
    pagamento: @payment,
    presenca: @presence,
    modalidade_frete: @ship_type,
    frete: @ship_value,
    discount: @discount,
    total: @total,
    despesas_acessorias: @other_costs,
    informacoes_fisco: @fisco_informations,
    informacoes_complementares: @complement_information
  }
end