Class: Atum::Core::Schema::ParameterChoice
- Inherits:
-
Object
- Object
- Atum::Core::Schema::ParameterChoice
- Defined in:
- lib/atum/core/schema/parameter_choice.rb
Instance Attribute Summary collapse
-
#parameters ⇒ Object
readonly
Returns the value of attribute parameters.
-
#resource_name ⇒ Object
readonly
Returns the value of attribute resource_name.
Instance Method Summary collapse
- #description ⇒ Object
-
#initialize(resource_name, parameters) ⇒ ParameterChoice
constructor
A new instance of ParameterChoice.
- #name ⇒ Object
Constructor Details
#initialize(resource_name, parameters) ⇒ ParameterChoice
Returns a new instance of ParameterChoice.
7 8 9 10 |
# File 'lib/atum/core/schema/parameter_choice.rb', line 7 def initialize(resource_name, parameters) @resource_name = resource_name @parameters = parameters end |
Instance Attribute Details
#parameters ⇒ Object (readonly)
Returns the value of attribute parameters.
5 6 7 |
# File 'lib/atum/core/schema/parameter_choice.rb', line 5 def parameters @parameters end |
#resource_name ⇒ Object (readonly)
Returns the value of attribute resource_name.
5 6 7 |
# File 'lib/atum/core/schema/parameter_choice.rb', line 5 def resource_name @resource_name end |
Instance Method Details
#description ⇒ Object
12 13 14 |
# File 'lib/atum/core/schema/parameter_choice.rb', line 12 def description @parameters.map(&:description).join(' or ') end |
#name ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'lib/atum/core/schema/parameter_choice.rb', line 16 def name @parameters.map do |parameter| if parameter.resource_name parameter.name else "#{@resource_name}_#{parameter.name}" end end.join('_or_') end |