class ReverseParameters::BaseCollection
Public Class Methods
new(collection, **options)
click to toggle source
# File lib/reverse_parameters.rb, line 53 def initialize(collection, **options) @collection = collection.map { |state, name| item_class.new(state: state, name: name, **options) } end
Public Instance Methods
[](value)
click to toggle source
# File lib/reverse_parameters.rb, line 69 def [](value) @collection[value] end
each(&block)
click to toggle source
# File lib/reverse_parameters.rb, line 57 def each(&block) @collection.send(:each, &block) end
to_a()
click to toggle source
# File lib/reverse_parameters.rb, line 65 def to_a map(&:to_s) end
to_s()
click to toggle source
# File lib/reverse_parameters.rb, line 61 def to_s to_a.join(', ') end