Class: ActiveVlc::Parameter
- Inherits:
-
Object
- Object
- ActiveVlc::Parameter
- Defined in:
- lib/activevlc/parameters/parameter.rb
Overview
Represent a parameter for a certain option in a Pipeline
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(name, value = nil) ⇒ Parameter
constructor
Creates a named parameter.
- #set? ⇒ Boolean
- #to_s ⇒ Object
Constructor Details
#initialize(name, value = nil) ⇒ Parameter
Creates a named parameter. ‘name’ if the parameter’s name and ‘value’ is its default value
11 12 13 14 |
# File 'lib/activevlc/parameters/parameter.rb', line 11 def initialize(name, value = nil) @name = name @value = value end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/activevlc/parameters/parameter.rb', line 5 def name @name end |
#value ⇒ Object
Returns the value of attribute value.
4 5 6 |
# File 'lib/activevlc/parameters/parameter.rb', line 4 def value @value end |
Instance Method Details
#set? ⇒ Boolean
16 17 18 |
# File 'lib/activevlc/parameters/parameter.rb', line 16 def set? not value.nil? end |
#to_s ⇒ Object
20 21 22 23 24 25 26 |
# File 'lib/activevlc/parameters/parameter.rb', line 20 def to_s if @value @value.to_s else "value for #{name} not set" end end |