Class: OpenAPISourceTools::Ordering::KeyPathOrder

Inherits:
Object
  • Object
show all
Includes:
Comparable
Defined in:
lib/openapi/sourcetools/order.rb

Overview

Holds KeyPath and the order that was specified.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(key_path, order) ⇒ KeyPathOrder

Returns a new instance of KeyPathOrder.



261
262
263
264
# File 'lib/openapi/sourcetools/order.rb', line 261

def initialize(key_path, order)
  @path = key_path
  @order = order
end

Instance Attribute Details

#orderObject (readonly)

Returns the value of attribute order.



259
260
261
# File 'lib/openapi/sourcetools/order.rb', line 259

def order
  @order
end

#pathObject (readonly)

Returns the value of attribute path.



259
260
261
# File 'lib/openapi/sourcetools/order.rb', line 259

def path
  @path
end

Instance Method Details

#<=>(other) ⇒ Object



266
267
268
# File 'lib/openapi/sourcetools/order.rb', line 266

def <=>(other)
  @path <=> other.path
end