class HappyMapper::Attribute
Attributes
default[RW]
Public Class Methods
new(name, type, o={})
click to toggle source
@see Item#initialize Additional options:
:default => Object The default value for this
Calls superclass method
# File lib/happymapper/attribute.rb, line 8 def initialize(name, type, o={}) super self.default = o[:default] end
Public Instance Methods
find(node, namespace, xpath_options) { |xpath| ... }
click to toggle source
# File lib/happymapper/attribute.rb, line 13 def find(node, namespace, xpath_options) if options[:xpath] yield(node.xpath(options[:xpath],xpath_options)) else yield(node[tag]) end end