Class: ActiveVlc::Parameter

Inherits:
Object
  • Object
show all
Defined in:
lib/activevlc/parameters/parameter.rb

Overview

Represent a parameter for a certain option in a Pipeline

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#nameObject (readonly)

Returns the value of attribute name.



5
6
7
# File 'lib/activevlc/parameters/parameter.rb', line 5

def name
  @name
end

#valueObject

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

Returns:

  • (Boolean)


16
17
18
# File 'lib/activevlc/parameters/parameter.rb', line 16

def set?
  not value.nil?
end

#to_sObject



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