Class: RBoss::Cli::ResultParser::Type
- Inherits:
-
Object
- Object
- RBoss::Cli::ResultParser::Type
- Defined in:
- lib/rboss/cli/result_parser.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #convert(value) ⇒ Object
-
#initialize(name, &block) ⇒ Type
constructor
A new instance of Type.
- #to_s ⇒ Object
Constructor Details
#initialize(name, &block) ⇒ Type
Returns a new instance of Type.
40 41 42 43 |
# File 'lib/rboss/cli/result_parser.rb', line 40 def initialize (name, &block) @name = name @converter_block = block end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
38 39 40 |
# File 'lib/rboss/cli/result_parser.rb', line 38 def name @name end |
Instance Method Details
#convert(value) ⇒ Object
45 46 47 |
# File 'lib/rboss/cli/result_parser.rb', line 45 def convert (value) @converter_block.call value end |
#to_s ⇒ Object
49 50 51 |
# File 'lib/rboss/cli/result_parser.rb', line 49 def to_s @name end |