Class: Aruba::BasicConfiguration::Option

Inherits:
Object
  • Object
show all
Defined in:
lib/aruba/basic_configuration/option.rb

Overview

A configuration option

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(opts = {}) ⇒ Option

Create option

Raises:

  • (ArgumentError)


14
15
16
17
18
19
20
21
22
23
24
# File 'lib/aruba/basic_configuration/option.rb', line 14

def initialize(opts = {})
  name = opts[:name]
  value = opts[:value]

  raise ArgumentError, '"name" is required' unless opts.key? :name
  raise ArgumentError, '"value" is required' unless opts.key? :value

  @name          = name
  @value         = value
  @default_value = value
end

Instance Attribute Details

#default_valueObject (readonly)

Returns the value of attribute default_value.



11
12
13
# File 'lib/aruba/basic_configuration/option.rb', line 11

def default_value
  @default_value
end

#nameObject

Returns the value of attribute name.



10
11
12
# File 'lib/aruba/basic_configuration/option.rb', line 10

def name
  @name
end

#valueObject

Returns the value of attribute value.



10
11
12
# File 'lib/aruba/basic_configuration/option.rb', line 10

def value
  @value
end

Instance Method Details

#==(other) ⇒ Object

Compare option



27
28
29
# File 'lib/aruba/basic_configuration/option.rb', line 27

def ==(other)
  name == other.name && value == other.value
end