Class: SAXMachine::SAXConfig::AttributeConfig

Inherits:
ElementValueConfig show all
Defined in:
lib/sax-machine/config/sax_attribute.rb

Instance Attribute Summary

Attributes inherited from ElementValueConfig

#data_class, #name, #setter

Instance Method Summary collapse

Methods inherited from ElementValueConfig

#column, #initialize, #required?

Constructor Details

This class inherits a constructor from SAXMachine::SAXConfig::ElementValueConfig

Instance Method Details

#attrs_match?(attrs) ⇒ Boolean Also known as: has_value_and_attrs_match?

Returns:

  • (Boolean)


8
9
10
# File 'lib/sax-machine/config/sax_attribute.rb', line 8

def attrs_match?(attrs)
  attrs.key?(@name) || attrs.value?(@name)
end

#collection?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/sax-machine/config/sax_attribute.rb', line 13

def collection?
  false
end

#value_from_attrs(attrs) ⇒ Object



4
5
6
# File 'lib/sax-machine/config/sax_attribute.rb', line 4

def value_from_attrs(attrs)
  attrs.fetch(@name, nil)
end