Parent

SAXMachine::SAXConfig::AttributeConfig

Attributes

name[R]
setter[R]

Public Class Methods

new(name, options) click to toggle source
# File lib/sax-machine/sax_attribute_config.rb, line 7
def initialize(name, options)
  @name = name.to_s
  @as = options[:as]
  @setter = "#{@as}="
  @required = options[:required]
end

Public Instance Methods

attrs_match?(attrs) click to toggle source
# File lib/sax-machine/sax_attribute_config.rb, line 26
def attrs_match?(attrs)
  attrs.index(@name) ? true : false
end
collection?() click to toggle source
# File lib/sax-machine/sax_attribute_config.rb, line 34
def collection?
  false
end
column() click to toggle source
# File lib/sax-machine/sax_attribute_config.rb, line 14
def column
  @as || @name.to_sym
end
has_value_and_attrs_match?(attrs) click to toggle source
# File lib/sax-machine/sax_attribute_config.rb, line 30
def has_value_and_attrs_match?(attrs)
  attrs_match?(attrs)
end
required?() click to toggle source
# File lib/sax-machine/sax_attribute_config.rb, line 18
def required?
  @required
end
value_from_attrs(attrs) click to toggle source
# File lib/sax-machine/sax_attribute_config.rb, line 22
def value_from_attrs(attrs)
  attrs.index(@name) ? attrs[attrs.index(@name) + 1] : nil
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.