Sha256: 8b4f2661be20999e48372c29800f2f6335b4b6c92ba92294b010d6295973365b
Contents?: true
Size: 1000 Bytes
Versions: 1
Compression:
Stored size: 1000 Bytes
Contents
module MoneyS3 module Builders module BaseBuilder attr_accessor :name, :data, :options def initialize(name, data = {}, options = {}) @name = name @data = data || {} @options = options || {} end def to_xml encoding = options[:encoding] doc_options = { version: '1.0' } doc_options[:encoding] = encoding if encoding doc = Ox::Document.new(doc_options) doc << builder dump_options = { with_xml: true } dump_options[:encoding] = encoding if encoding Ox.dump(doc, dump_options) end def build_element(name, content) element = Ox::Element.new(name) if content.respond_to? :attributes content.attributes.each { |k, v| element[k] = v } end if content.respond_to? :value element << content.value if content.value else element << content if content end element end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
money_s3-0.10.0 | lib/money_s3/builders/base_builder.rb |