Module: ActiveModel::Access

Included in:
Model, ActiveRecord::Core
Defined in:
activemodel/lib/active_model/access.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#slice(*methods) ⇒ Object



8
9
10
# File 'activemodel/lib/active_model/access.rb', line 8

def slice(*methods)
  methods.flatten.index_with { |method| public_send(method) }.with_indifferent_access
end

#values_at(*methods) ⇒ Object



12
13
14
# File 'activemodel/lib/active_model/access.rb', line 12

def values_at(*methods)
  methods.flatten.map! { |method| public_send(method) }
end