Class: Einvoice::Tradevan::Model::Base

Inherits:
Object
  • Object
show all
Includes:
ActiveModel::Model, ActiveModel::Serialization, ActiveModel::Serializers::JSON, ActiveModel::Validations, Validator
Defined in:
lib/einvoice/tradevan/model/base.rb

Direct Known Subclasses

IssueData, IssueItem, VoidData

Instance Method Summary collapse

Instance Method Details

#attributesObject



28
29
30
# File 'lib/einvoice/tradevan/model/base.rb', line 28

def attributes
  instance_values
end

#attributes=(hash) ⇒ Object



16
17
18
19
20
21
22
23
24
25
26
# File 'lib/einvoice/tradevan/model/base.rb', line 16

def attributes=(hash)
  @itemList ||= []
  hash.each do |key, value|
    case key.to_sym
    when :itemList
      value.each { |v| @itemList << IssueItem.new(v) }
    else
      send("#{key}=", value)
    end
  end
end