Module: KeyDial
- Defined in:
- lib/key_dial.rb,
lib/key_dial/version.rb,
lib/key_dial/coercion.rb,
lib/key_dial/key_dialler.rb
Defined Under Namespace
Modules: Coercion Classes: KeyDialler
Constant Summary collapse
- VERSION =
"1.2.0"
Instance Method Summary collapse
-
#call(*lookup) ⇒ Object
Called directly on a keyed object, immediately dials and calls the keys specified as arguments.
-
#to_dial(*lookup) ⇒ Object
(also: #dial)
Called on a Hash, Array or Struct, returns a KeyDialler object, ready to dial keys against that Hash, Array or Struct.
Instance Method Details
#call(*lookup) ⇒ Object
Called directly on a keyed object, immediately dials and calls the keys specified as arguments. Returns the value found, or nil. A default cannot be specified.
21 22 23 |
# File 'lib/key_dial.rb', line 21 def call(*lookup) return KeyDialler.new(self, *lookup).call end |
#to_dial(*lookup) ⇒ Object Also known as: dial
Called on a Hash, Array or Struct, returns a KeyDialler object, ready to dial keys against that Hash, Array or Struct.
11 12 13 |
# File 'lib/key_dial.rb', line 11 def to_dial(*lookup) return KeyDialler.new(self, *lookup) end |