Class: Rangeable::BoundaryIndex::TransitionEvent

Inherits:
Struct
  • Object
show all
Defined in:
lib/rangeable/boundary_index.rb

Overview

Public TransitionEvent type returned by ‘Rangeable#transitions`. `coordinate` is normally an Integer; it is `nil` for close events whose underlying interval ends at the implementation’s +∞ sentinel (i.e. ‘hi` was the maximum representable boundary in the cross-language contract). `kind` is `:open` or `:close`.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#coordinateObject

Returns the value of attribute coordinate

Returns:

  • (Object)

    the current value of coordinate



29
30
31
# File 'lib/rangeable/boundary_index.rb', line 29

def coordinate
  @coordinate
end

#elementObject

Returns the value of attribute element

Returns:

  • (Object)

    the current value of element



29
30
31
# File 'lib/rangeable/boundary_index.rb', line 29

def element
  @element
end

#kindObject

Returns the value of attribute kind

Returns:

  • (Object)

    the current value of kind



29
30
31
# File 'lib/rangeable/boundary_index.rb', line 29

def kind
  @kind
end

#ordObject

Returns the value of attribute ord

Returns:

  • (Object)

    the current value of ord



29
30
31
# File 'lib/rangeable/boundary_index.rb', line 29

def ord
  @ord
end

Instance Method Details

#close?Boolean

Returns:

  • (Boolean)


34
35
36
# File 'lib/rangeable/boundary_index.rb', line 34

def close?
  kind == :close
end

#open?Boolean

Returns:

  • (Boolean)


30
31
32
# File 'lib/rangeable/boundary_index.rb', line 30

def open?
  kind == :open
end

#to_hObject



38
39
40
# File 'lib/rangeable/boundary_index.rb', line 38

def to_h
  { coordinate: coordinate, kind: kind, element: element }
end