Class: CustomizationDatum
- Inherits:
-
Object
- Object
- CustomizationDatum
- Extended by:
- EnumerateIt
- Defined in:
- app/models/customization_datum.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#data_type ⇒ Object
readonly
Returns the value of attribute data_type.
-
#dependency_name ⇒ Object
readonly
Returns the value of attribute dependency_name.
-
#dependency_value ⇒ Object
readonly
Returns the value of attribute dependency_value.
-
#modal_entity ⇒ Object
readonly
Returns the value of attribute modal_entity.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#required ⇒ Object
readonly
Returns the value of attribute required.
Instance Method Summary collapse
- #humanized_option(key) ⇒ Object
-
#initialize(attrs = {}) ⇒ CustomizationDatum
constructor
A new instance of CustomizationDatum.
- #method_name ⇒ Object
- #normalized_data ⇒ Object
Constructor Details
#initialize(attrs = {}) ⇒ CustomizationDatum
Returns a new instance of CustomizationDatum.
9 10 11 12 13 |
# File 'app/models/customization_datum.rb', line 9 def initialize(attrs = {}) attrs.each do |name, value| send "#{name}=", value end end |
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
4 5 6 |
# File 'app/models/customization_datum.rb', line 4 def data @data end |
#data_type ⇒ Object
Returns the value of attribute data_type.
4 5 6 |
# File 'app/models/customization_datum.rb', line 4 def data_type @data_type end |
#dependency_name ⇒ Object
Returns the value of attribute dependency_name.
4 5 6 |
# File 'app/models/customization_datum.rb', line 4 def dependency_name @dependency_name end |
#dependency_value ⇒ Object
Returns the value of attribute dependency_value.
4 5 6 |
# File 'app/models/customization_datum.rb', line 4 def dependency_value @dependency_value end |
#modal_entity ⇒ Object
Returns the value of attribute modal_entity.
4 5 6 |
# File 'app/models/customization_datum.rb', line 4 def modal_entity @modal_entity end |
#options ⇒ Object
Returns the value of attribute options.
4 5 6 |
# File 'app/models/customization_datum.rb', line 4 def @options end |
#required ⇒ Object
Returns the value of attribute required.
4 5 6 |
# File 'app/models/customization_datum.rb', line 4 def required @required end |
Instance Method Details
#humanized_option(key) ⇒ Object
27 28 29 |
# File 'app/models/customization_datum.rb', line 27 def humanized_option(key) @options.is_a?(Hash) ? @options[key] : key end |
#method_name ⇒ Object
31 32 33 |
# File 'app/models/customization_datum.rb', line 31 def method_name modal? ? "#{normalized_data}_id" : normalized_data end |
#normalized_data ⇒ Object
15 16 17 |
# File 'app/models/customization_datum.rb', line 15 def normalized_data @data.parameterize('_') end |