Class: Poefy::CoreExtensions::IndexValueArray

Inherits:
Struct
  • Object
show all
Includes:
Enumerable
Defined in:
lib/poefy/core_extensions/array.rb

Overview

Output struct for #by_distance method. Array is the most useful data, but index and value are also kept.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#arrayObject Also known as: to_a

Returns the value of attribute array

Returns:

  • (Object)

    the current value of array



24
25
26
# File 'lib/poefy/core_extensions/array.rb', line 24

def array
  @array
end

#indexObject

Returns the value of attribute index

Returns:

  • (Object)

    the current value of index



24
25
26
# File 'lib/poefy/core_extensions/array.rb', line 24

def index
  @index
end

#valueObject

Returns the value of attribute value

Returns:

  • (Object)

    the current value of value



24
25
26
# File 'lib/poefy/core_extensions/array.rb', line 24

def value
  @value
end

Instance Method Details

#each(&block) ⇒ Object



27
28
29
30
31
# File 'lib/poefy/core_extensions/array.rb', line 27

def each &block
  array.each do |i|
    block.call i
  end
end