Module: MdData::MdDataClassMethods
- Defined in:
- lib/md_data/md_data.rb
Instance Method Summary collapse
- #dimension(name, allowed_values) ⇒ Object
- #dimensions ⇒ Object
- #select(attributes, parent = nil) ⇒ Object
- #table_data(&block) ⇒ Object
Instance Method Details
#dimension(name, allowed_values) ⇒ Object
48 49 50 |
# File 'lib/md_data/md_data.rb', line 48 def dimension(name, allowed_values) dimensions[name] = allowed_values end |
#dimensions ⇒ Object
52 53 54 |
# File 'lib/md_data/md_data.rb', line 52 def dimensions @dimensions ||= {} end |
#select(attributes, parent = nil) ⇒ Object
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/md_data/md_data.rb', line 32 def select(attributes, parent = nil) @rules = [] @current_context = nil load_rules if (parent.nil?) container = self.new else container = self.new(parent) end container.attributes = attributes container.define_helpers_methods(dimensions, attributes) define_dimension_values_methods define_select_from_rules container.select_from_rules(@rules) end |
#table_data(&block) ⇒ Object
28 29 30 |
# File 'lib/md_data/md_data.rb', line 28 def table_data(&block) @table_data_block = block end |