Sha256: 26e9da9ed33ca1fcc14b2d6368427b0f7d1ce43dbb80aed6a04198ba6010ff54

Contents?: true

Size: 609 Bytes

Versions: 1

Compression:

Stored size: 609 Bytes

Contents

require 'money_s3/parsers/base_parser'
require 'money_s3/parsers/child_kusovnik_type'
require 'money_s3/parsers/reference'

module MoneyS3
  module Parsers
    class KomponentaKusovnikType
      include BaseParser

      def child
        submodel_at(ChildKusovnikType, 'Child')
      end

      def reference
        submodel_at(Reference, 'Reference')
      end

      def to_h
        hash = WithAttributes.new({})
        hash.attributes = attributes

        hash[:child] = child.to_h if has? 'Child'
        hash[:reference] = reference.to_h if has? 'Reference'

        hash
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
money_s3-0.6.0 lib/money_s3/parsers/komponenta_kusovnik_type.rb