Class: MoneyS3::Parsers::SlevaType

Inherits:
Object
  • Object
show all
Includes:
ParserCore::BaseParser
Defined in:
lib/money_s3/parsers/sleva_type.rb

Instance Method Summary collapse

Instance Method Details

#limitObject



6
7
8
# File 'lib/money_s3/parsers/sleva_type.rb', line 6

def limit
  at 'Limit'
end

#limit_attributesObject



10
11
12
# File 'lib/money_s3/parsers/sleva_type.rb', line 10

def limit_attributes
  attributes_at 'Limit'
end

#slevaObject



14
15
16
# File 'lib/money_s3/parsers/sleva_type.rb', line 14

def sleva
  at 'Sleva'
end

#sleva_attributesObject



18
19
20
# File 'lib/money_s3/parsers/sleva_type.rb', line 18

def sleva_attributes
  attributes_at 'Sleva'
end

#to_hObject



22
23
24
25
26
27
28
29
30
31
32
# File 'lib/money_s3/parsers/sleva_type.rb', line 22

def to_h
  hash = {}
  hash[:attributes] = attributes

  hash[:limit] = limit if has? 'Limit'
  hash[:limit_attributes] = limit_attributes if has? 'Limit'
  hash[:sleva] = sleva if has? 'Sleva'
  hash[:sleva_attributes] = sleva_attributes if has? 'Sleva'

  hash
end