Class: RBoss::Cli::ResultParser::Type

Inherits:
Object
  • Object
show all
Defined in:
lib/rboss/cli/result_parser.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#nameObject (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_sObject



49
50
51
# File 'lib/rboss/cli/result_parser.rb', line 49

def to_s
  @name
end