Class: Complicode::Generators::Data

Inherits:
Object
  • Object
show all
Defined in:
lib/complicode/generators/data.rb

Class Method Summary collapse

Class Method Details

.call(authorization_code, invoice, partial_keys) ⇒ String


10
11
12
13
14
15
16
17
18
# File 'lib/complicode/generators/data.rb', line 10

def self.call(authorization_code, invoice, partial_keys)
  authorization_code += partial_keys[0].value

  %i[number nit issue_date amount].each.with_index(1) do |attribute, index|
    invoice.append_to(attribute, partial_keys[index].value)
  end

  authorization_code + invoice.concat
end