Class: Humidifier::Output
- Inherits:
-
Object
- Object
- Humidifier::Output
- Defined in:
- lib/humidifier/output.rb
Instance Attribute Summary collapse
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#export_name ⇒ Object
readonly
Returns the value of attribute export_name.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ Output
constructor
A new instance of Output.
- #to_cf ⇒ Object
Constructor Details
#initialize(opts = {}) ⇒ Output
Returns a new instance of Output.
7 8 9 10 11 |
# File 'lib/humidifier/output.rb', line 7 def initialize(opts = {}) @description = opts[:description] @value = opts[:value] @export_name = opts[:export_name] end |
Instance Attribute Details
#description ⇒ Object (readonly)
Returns the value of attribute description.
5 6 7 |
# File 'lib/humidifier/output.rb', line 5 def description @description end |
#export_name ⇒ Object (readonly)
Returns the value of attribute export_name.
5 6 7 |
# File 'lib/humidifier/output.rb', line 5 def export_name @export_name end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
5 6 7 |
# File 'lib/humidifier/output.rb', line 5 def value @value end |
Instance Method Details
#to_cf ⇒ Object
13 14 15 16 17 18 |
# File 'lib/humidifier/output.rb', line 13 def to_cf { "Value" => Serializer.dump(value) }.tap do |cf| cf["Description"] = description if description cf["Export"] = { "Name" => export_name } if export_name end end |