Module: YADM::Mapping::DSL
- Included in:
- YADM::Mapping
- Defined in:
- lib/yadm/mapping.rb
Instance Method Summary collapse
- #attribute(name, type) ⇒ Object
- #attributes ⇒ Object
- #collection(new_collection = nil) ⇒ Object
- #data_source(data_source_identifier = nil) ⇒ Object
Instance Method Details
#attribute(name, type) ⇒ Object
60 61 62 |
# File 'lib/yadm/mapping.rb', line 60 def attribute(name, type) attributes[name] = Attribute.new(type) end |
#attributes ⇒ Object
64 65 66 |
# File 'lib/yadm/mapping.rb', line 64 def attributes @attributes ||= {} end |
#collection(new_collection = nil) ⇒ Object
52 53 54 55 56 57 58 |
# File 'lib/yadm/mapping.rb', line 52 def collection(new_collection = nil) if new_collection.nil? @collection else @collection = new_collection end end |
#data_source(data_source_identifier = nil) ⇒ Object
44 45 46 47 48 49 50 |
# File 'lib/yadm/mapping.rb', line 44 def data_source(data_source_identifier = nil) if data_source_identifier.nil? @data_source else @data_source = YADM.data_sources.fetch(data_source_identifier) end end |