Class: Peanuts::Mapping
- Inherits:
-
Object
- Object
- Peanuts::Mapping
- Defined in:
- lib/peanuts/mappings.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#local_name ⇒ Object
readonly
Returns the value of attribute local_name.
-
#namespace_uri ⇒ Object
readonly
Returns the value of attribute namespace_uri.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#prefix ⇒ Object
readonly
Returns the value of attribute prefix.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(local_name, options) ⇒ Mapping
constructor
A new instance of Mapping.
- #matches?(reader) ⇒ Boolean
Constructor Details
#initialize(local_name, options) ⇒ Mapping
Returns a new instance of Mapping.
11 12 13 |
# File 'lib/peanuts/mappings.rb', line 11 def initialize(local_name, ) @local_name, @namespace_uri, @prefix, @options = local_name.to_s, .delete(:ns), .delete(:prefix), end |
Instance Attribute Details
#local_name ⇒ Object (readonly)
Returns the value of attribute local_name.
9 10 11 |
# File 'lib/peanuts/mappings.rb', line 9 def local_name @local_name end |
#namespace_uri ⇒ Object (readonly)
Returns the value of attribute namespace_uri.
9 10 11 |
# File 'lib/peanuts/mappings.rb', line 9 def namespace_uri @namespace_uri end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
9 10 11 |
# File 'lib/peanuts/mappings.rb', line 9 def @options end |
#prefix ⇒ Object (readonly)
Returns the value of attribute prefix.
9 10 11 |
# File 'lib/peanuts/mappings.rb', line 9 def prefix @prefix end |
Class Method Details
.node_type(node_type) ⇒ Object
21 22 23 |
# File 'lib/peanuts/mappings.rb', line 21 def self.node_type(node_type) define_method(:node_type) { node_type } end |
Instance Method Details
#matches?(reader) ⇒ Boolean
15 16 17 18 19 |
# File 'lib/peanuts/mappings.rb', line 15 def matches?(reader) node_type == reader.node_type && local_name == reader.local_name && namespace_uri == reader.namespace_uri end |