Module: XMLMapping::ClassMethods
- Defined in:
- lib/xmlmapping.rb
Instance Method Summary collapse
- #ensure(message, &block) ⇒ Object
- #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
#ensure(message, &block) ⇒ Object
160 161 |
# File 'lib/xmlmapping.rb', line 160 def ensure(, &block) end |
#has_attribute(attribute, options = {}) ⇒ Object
151 152 153 |
# File 'lib/xmlmapping.rb', line 151 def has_attribute(attribute, = {}) add(attribute, :attribute, ) end |
#has_many(attribute, options = {}) ⇒ Object
146 147 148 149 |
# File 'lib/xmlmapping.rb', line 146 def has_many(attribute, = {}) [:cardinality] = :many add(attribute, :element, ) end |
#has_one(attribute, options = {}) ⇒ Object
141 142 143 144 |
# File 'lib/xmlmapping.rb', line 141 def has_one(attribute, = {}) [:cardinality] = :one add(attribute, :element, ) end |
#mappings ⇒ Object
132 133 134 |
# File 'lib/xmlmapping.rb', line 132 def mappings @mappings || superclass.mappings end |
#namespace(namespace) ⇒ Object
136 137 138 139 |
# File 'lib/xmlmapping.rb', line 136 def namespace(namespace) initialize_vars @mappings[:namespace] = namespace end |
#raw_mappings ⇒ Object
128 129 130 |
# File 'lib/xmlmapping.rb', line 128 def raw_mappings @raw_mappings || superclass.raw_mappings end |
#text(attribute, options = {}) ⇒ Object
155 156 157 158 |
# File 'lib/xmlmapping.rb', line 155 def text(attribute, = {}) [:namespace] = :any add(attribute, :text, ) end |