Sha256: 6980950144d364740e80029b6227efc6cbe8b828b01556d25f06110a40ed9f75

Contents?: true

Size: 402 Bytes

Versions: 8

Compression:

Stored size: 402 Bytes

Contents

require 'ox'
require 'money_s3/money_data'

module MoneyS3
  def self.parse(raw)
    hash = Ox.load(raw, mode: :hash)

    if hash.key? :MoneyData
      content = hash[:MoneyData]

      raw =
        if content.is_a? Array
          content.shift
          content.inject({}) { |memo, member| memo.merge(member) }
        else
          content
        end

      MoneyData.new(raw)
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
money_s3-0.3.0 lib/money_s3.rb
money_s3-0.2.0 lib/money_s3.rb
money_s3-0.1.8 lib/money_s3.rb
money_s3-0.1.7 lib/money_s3.rb
money_s3-0.1.6 lib/money_s3.rb
money_s3-0.1.5 lib/money_s3.rb
money_s3-0.1.4 lib/money_s3.rb
money_s3-0.1.3 lib/money_s3.rb