Sha256: 25f02aa497249184526cfcec85e20394e78451e388d09fcabe1e5d8b2eb91c7d

Contents?: true

Size: 447 Bytes

Versions: 10

Compression:

Stored size: 447 Bytes

Contents

require 'pump/xml/node'

module Pump
  class Xml
    class Value < Node
      attr_accessor :options

      def plain
        "object.#{name}"
      end

      def to_s(plain_path=nil)
        "\#{#{plain_path || plain}#{cast}}"
      end

      private

      def cast
        if options[:typecast]
          ".#{options[:typecast]}"
        elsif !options[:xmlsafe]
          '.to_s.encode(:xml => :text)'
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
pump-0.6.4 lib/pump/xml/value.rb
pump-0.6.3 lib/pump/xml/value.rb
pump-0.6.2 lib/pump/xml/value.rb
pump-0.6.1 lib/pump/xml/value.rb
pump-0.6.0 lib/pump/xml/value.rb
pump-0.5.1 lib/pump/xml/value.rb
pump-0.5.0 lib/pump/xml/value.rb
pump-0.4.0 lib/pump/xml/value.rb
pump-0.3.0 lib/pump/xml/value.rb
pump-0.2.0 lib/pump/xml/value.rb