Sha256: 72eb7b811b49ccf8a92988e36461146f6da566dc42731f9219620865e36ce879

Contents?: true

Size: 368 Bytes

Versions: 23

Compression:

Stored size: 368 Bytes

Contents

# Object#with -- by Dan Yoder, dev.zeraweb.com -- this is something from Pascal
# and JavaScript. here's the use case.

# instead of:
#   some_object.do_x
#   some_object.do_y
#   some_object.do_z
#
# you can instead do:
#   with(some_object)
#     do_x
#     do_y
#     do_z
#   end

class Object
  def with(object, &block)
    object.instance_eval &block
  end
end

Version data entries

23 entries across 23 versions & 7 rubygems

Version Path
FreedomCoder-utility_belt-1.1.1.2 lib/utility_belt/with.rb
FreedomCoder-utility_belt-1.1.1 lib/utility_belt/with.rb
akitaonrails-utility_belt-1.0.10 lib/utility_belt/with.rb
akitaonrails-utility_belt-1.0.11 lib/utility_belt/with.rb
akitaonrails-utility_belt-1.0.12 lib/utility_belt/with.rb
mguterl-utility_belt-1.0.7 lib/utility_belt/with.rb
rwilcox-utility_belt-1.0.7 lib/utility_belt/with.rb
rwilcox-utility_belt-1.0.9 lib/utility_belt/with.rb
timocratic-utility_belt-1.0.7.1 lib/utility_belt/with.rb
timocratic-utility_belt-1.0.7.2 lib/utility_belt/with.rb
timocratic-utility_belt-1.0.7.3 lib/utility_belt/with.rb
flyrb-1.0.0.c lib/flyrb/with.rb
flyrb-1.0.0.b lib/flyrb/with.rb
flyrb-1.0.0.a lib/flyrb/with.rb
akitaonrails-utility_belt-1.0.13 lib/utility_belt/with.rb
utility_belt-1.0.5 lib/with.rb
utility_belt-1.0.1 lib/with.rb
utility_belt-1.0.6 lib/with.rb
utility_belt-1.1.0 lib/utility_belt/with.rb
utility_belt-1.0.4 lib/with.rb