Module: XMLMapping::ClassMethods
- Defined in:
- lib/xmlmapping.rb
Instance Method Summary collapse
- #has_attribute(attribute, options = {}) ⇒ Object
- #has_many(attribute, options = {}) ⇒ Object
- #has_one(attribute, options = {}) ⇒ Object
- #mappings ⇒ Object
- #namespace(namespace) ⇒ Object
- #raw_mappings ⇒ Object
- #text(attribute, options = {}) ⇒ Object
Instance Method Details
#has_attribute(attribute, options = {}) ⇒ Object
147 148 149 |
# File 'lib/xmlmapping.rb', line 147 def has_attribute(attribute, = {}) add(attribute, :attribute, ) end |
#has_many(attribute, options = {}) ⇒ Object
142 143 144 145 |
# File 'lib/xmlmapping.rb', line 142 def has_many(attribute, = {}) [:cardinality] = :many add(attribute, :element, ) end |
#has_one(attribute, options = {}) ⇒ Object
137 138 139 140 |
# File 'lib/xmlmapping.rb', line 137 def has_one(attribute, = {}) [:cardinality] = :one add(attribute, :element, ) end |
#mappings ⇒ Object
128 129 130 |
# File 'lib/xmlmapping.rb', line 128 def mappings @mappings || superclass.mappings end |
#namespace(namespace) ⇒ Object
132 133 134 135 |
# File 'lib/xmlmapping.rb', line 132 def namespace(namespace) initialize_vars @mappings[:namespace] = namespace end |
#raw_mappings ⇒ Object
124 125 126 |
# File 'lib/xmlmapping.rb', line 124 def raw_mappings @raw_mappings || superclass.raw_mappings end |
#text(attribute, options = {}) ⇒ Object
151 152 153 154 |
# File 'lib/xmlmapping.rb', line 151 def text(attribute, = {}) [:namespace] = :any add(attribute, :text, ) end |