Class: BlingApi::Installment

Inherits:
Object
  • Object
show all
Defined in:
lib/bling_api/installment.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id_forma_pagamento:, valor:, data_vencimento:, observacoes: "", id: nil) ⇒ Installment

Returns a new instance of Installment.



5
6
7
8
9
10
11
# File 'lib/bling_api/installment.rb', line 5

def initialize(id_forma_pagamento:, valor:, data_vencimento:, observacoes: "", id: nil)
  @id_forma_pagamento = id_forma_pagamento
  @valor = valor
  @data_vencimento = data_vencimento
  @observacoes = observacoes
  @id = id
end

Instance Attribute Details

#data_vencimentoObject (readonly)

Returns the value of attribute data_vencimento.



4
5
6
# File 'lib/bling_api/installment.rb', line 4

def data_vencimento
  @data_vencimento
end

#idObject (readonly)

Returns the value of attribute id.



4
5
6
# File 'lib/bling_api/installment.rb', line 4

def id
  @id
end

#id_forma_pagamentoObject (readonly)

Returns the value of attribute id_forma_pagamento.



4
5
6
# File 'lib/bling_api/installment.rb', line 4

def id_forma_pagamento
  @id_forma_pagamento
end

#observacoesObject (readonly)

Returns the value of attribute observacoes.



4
5
6
# File 'lib/bling_api/installment.rb', line 4

def observacoes
  @observacoes
end

#valorObject (readonly)

Returns the value of attribute valor.



4
5
6
# File 'lib/bling_api/installment.rb', line 4

def valor
  @valor
end

Instance Method Details

#to_api_hashObject



13
14
15
16
17
18
19
20
21
22
23
# File 'lib/bling_api/installment.rb', line 13

def to_api_hash
  {
    id: id,
    dataVencimento: data_vencimento,
    valor: valor,
    observacoes: observacoes,
    formaPagamento: {
      id: id_forma_pagamento
    }
  }
end