Sha256: 9cb69753bf2e2087435b7943af14eaf49a26a43e64435e8d6dd4abff9eaad03e

Contents?: true

Size: 402 Bytes

Versions: 9

Compression:

Stored size: 402 Bytes

Contents

module SAXMachine
  class SAXConfig
    class ElementValueConfig
      attr_reader :name, :setter

      def initialize(name, options)
        @name     = name.to_s
        @as       = options[:as]
        @setter   = "#{@as}="
        @required = options[:required]
      end

      def column
        @as || @name.to_sym
      end

      def required?
        !!@required
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
sax-machine-1.3.0 lib/sax-machine/config/sax_element_value.rb
sax-machine-1.2.0 lib/sax-machine/config/sax_element_value.rb
sax-machine-1.1.1 lib/sax-machine/config/sax_element_value.rb
sax-machine-1.1.0 lib/sax-machine/config/sax_element_value.rb
sax-machine-1.0.3 lib/sax-machine/config/sax_element_value.rb
sax-machine-1.0.2 lib/sax-machine/config/sax_element_value.rb
sax-machine-1.0.1 lib/sax-machine/config/sax_element_value.rb
sax-machine-1.0.0 lib/sax-machine/config/sax_element_value.rb
sax-machine-0.3.0 lib/sax-machine/config/sax_element_value.rb