Module: MdData
- Defined in:
- lib/md_data/md_data.rb,
lib/md_data/version.rb
Defined Under Namespace
Modules: MdDataClassMethods
Classes: NoRuleFound
Constant Summary
collapse
- VERSION =
"1.1.1"
Class Method Summary
collapse
Instance Method Summary
collapse
Class Method Details
.included(base) ⇒ Object
5
6
7
|
# File 'lib/md_data/md_data.rb', line 5
def self.included(base)
base.extend MdDataClassMethods
end
|
Instance Method Details
#attributes ⇒ Object
9
10
11
|
# File 'lib/md_data/md_data.rb', line 9
def attributes
@attributes
end
|
#attributes=(value) ⇒ Object
13
14
15
|
# File 'lib/md_data/md_data.rb', line 13
def attributes=(value)
@attributes = value
end
|
#define_helper(key) ⇒ Object
21
22
23
24
25
|
# File 'lib/md_data/md_data.rb', line 21
def define_helper(key)
Kernel.send(:define_method, key) do
(instance_variable_get "@attributes")[key]
end
end
|
#define_helpers_methods(dimensions, attributes) ⇒ Object
17
18
19
|
# File 'lib/md_data/md_data.rb', line 17
def define_helpers_methods(dimensions, attributes)
dimensions.merge(attributes).each_key { |key| define_helper(key) }
end
|