Class: CafeCar::Fields

Inherits:
Array
  • Object
show all
Includes:
Caching
Defined in:
lib/cafe_car/fields.rb

Instance Method Summary collapse

Methods included from Caching

#cache

Methods inherited from Array

#extract!, #overlap

Instance Method Details

#has?(name) ⇒ Boolean

Returns:

  • (Boolean)


19
# File 'lib/cafe_car/fields.rb', line 19

def has?(name) = by_name.key?(name)

#reverseObject



13
# File 'lib/cafe_car/fields.rb', line 13

def reverse = Fields.new(super)

#sort_with(obj) ⇒ Object



15
16
17
# File 'lib/cafe_car/fields.rb', line 15

def sort_with(obj)
  Fields.new(sort_by { obj.try(_1.name) })
end