Class: Brandmaker::Variable
- Inherits:
-
Object
- Object
- Brandmaker::Variable
show all
- Defined in:
- lib/brandmaker/variable.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(data, config = VariableConfig.new) ⇒ Variable
Returns a new instance of Variable.
7
8
9
10
|
# File 'lib/brandmaker/variable.rb', line 7
def initialize data, config = VariableConfig.new
@data = data
@config = config
end
|
Instance Attribute Details
#config ⇒ Object
Returns the value of attribute config.
5
6
7
|
# File 'lib/brandmaker/variable.rb', line 5
def config
@config
end
|
Instance Method Details
#data ⇒ Object
12
13
14
|
# File 'lib/brandmaker/variable.rb', line 12
def data
@data
end
|
#label ⇒ Object
29
30
31
|
# File 'lib/brandmaker/variable.rb', line 29
def label
config.label || technical_name.humanize
end
|
#purpose ⇒ Object
24
25
26
27
|
# File 'lib/brandmaker/variable.rb', line 24
def purpose
@data[:purpose] || config.purpose
end
|
#technical_name ⇒ Object
16
17
18
|
# File 'lib/brandmaker/variable.rb', line 16
def technical_name
@data[:technical_name]
end
|
#type_id ⇒ Object
33
34
35
|
# File 'lib/brandmaker/variable.rb', line 33
def type_id
@data[:variable_type_id]
end
|
#value ⇒ Object
20
21
22
|
# File 'lib/brandmaker/variable.rb', line 20
def value
@data[:value]
end
|