Class: Object

Inherits:
BasicObject
Defined in:
lib/justools/core_ext/object.rb

Instance Method Summary collapse

Instance Method Details

#aka {|_self| ... } ⇒ Object

Examples

{ :a=>1, .., :z=>26 }.aka { |h| h.each { |k, v| h[k] = v + h[26 - v] } }

User.find(15).stories.joins(:tasks).aka { |s| [s.class.to_s, s.count] }.
     aka { |klass_name, count| "#{count} stories in #{klass_name}" }

[15, { :includes => { :stories => :tasks } }, 56, 78, 102].
     aka { |id, opts, *ns| ns.each { |n| puts n }; User.find(id, opts) }

Yields:

  • (_self)

Yield Parameters:

  • _self (Object)

    the object that the method was called on



14
15
16
# File 'lib/justools/core_ext/object.rb', line 14

def aka(&block)
  yield self
end