Class: RedSnow::Sourcemap::Parameter
- Defined in:
- lib/redsnow/sourcemap.rb
Overview
Parameter source map node
Instance Attribute Summary collapse
-
#default_value ⇒ Sourcemap
default value of the parameter or nil.
-
#example_value ⇒ Sourcemap
example value of the parameter or nil.
-
#type ⇒ Sourcemap
an arbitrary type of the parameter or nil.
-
#use ⇒ Sourcemap
parameter necessity flag, ‘:required` or `:optional`.
-
#values ⇒ Array<Sourcemap>
an enumeration of possible parameter values.
Attributes inherited from NamedNode
Attributes inherited from Node
Instance Method Summary collapse
-
#initialize(sourcemap) ⇒ Parameter
constructor
A new instance of Parameter.
Constructor Details
#initialize(sourcemap) ⇒ Parameter
Returns a new instance of Parameter.
85 86 87 88 89 90 91 92 93 94 95 96 97 |
# File 'lib/redsnow/sourcemap.rb', line 85 def initialize(sourcemap) super(sourcemap) @type = SourceMap.new(sourcemap['type']) @use = SourceMap.new(sourcemap['required']) @default_value = SourceMap.new(sourcemap['default']) @example_value = SourceMap.new(sourcemap['example']) @values = [] sourcemap.key?('values') && sourcemap['values'].each do |value| @values << SourceMap.new(value['value']) end end |
Instance Attribute Details
#default_value ⇒ Sourcemap
default value of the parameter or nil
77 78 79 |
# File 'lib/redsnow/sourcemap.rb', line 77 def default_value @default_value end |
#example_value ⇒ Sourcemap
example value of the parameter or nil
77 78 79 |
# File 'lib/redsnow/sourcemap.rb', line 77 def example_value @example_value end |
#type ⇒ Sourcemap
an arbitrary type of the parameter or nil
77 78 79 |
# File 'lib/redsnow/sourcemap.rb', line 77 def type @type end |
#use ⇒ Sourcemap
parameter necessity flag, ‘:required` or `:optional`
77 78 79 |
# File 'lib/redsnow/sourcemap.rb', line 77 def use @use end |
#values ⇒ Array<Sourcemap>
an enumeration of possible parameter values
77 78 79 |
# File 'lib/redsnow/sourcemap.rb', line 77 def values @values end |