Class: Namero::Value

Inherits:
Object
  • Object
show all
Defined in:
lib/namero/value.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value:, candidates:, index:) ⇒ Value

Returns a new instance of Value.



6
7
8
9
10
# File 'lib/namero/value.rb', line 6

def initialize(value:, candidates:, index:)
  @value = value
  @candidates = candidates
  @index = index
end

Instance Attribute Details

#candidatesObject

Returns the value of attribute candidates.



4
5
6
# File 'lib/namero/value.rb', line 4

def candidates
  @candidates
end

#indexObject (readonly)

Returns the value of attribute index.



3
4
5
# File 'lib/namero/value.rb', line 3

def index
  @index
end

#valueObject

Returns the value of attribute value.



4
5
6
# File 'lib/namero/value.rb', line 4

def value
  @value
end

Instance Method Details

#dupObject



12
13
14
# File 'lib/namero/value.rb', line 12

def dup
  self.new(value: value, candidates: candidates.dup)
end