Class: Object

Inherits:
BasicObject
Defined in:
lib/mutate.rb

Instance Method Summary collapse

Instance Method Details

#impart(object) {|object, _self| ... } ⇒ Object

Yields:

  • (object, _self)

Yield Parameters:

  • _self (Object)

    the object that the method was called on



14
15
16
# File 'lib/mutate.rb', line 14

def impart object
  yield object, self
end

#keepObject



6
7
8
# File 'lib/mutate.rb', line 6

def keep
  if yield self ; self ; else ; nil ; end
end

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

Yields:

  • (_self)

Yield Parameters:

  • _self (Object)

    the object that the method was called on



2
3
4
# File 'lib/mutate.rb', line 2

def mutate
  yield self
end

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

Yields:

  • (_self)

Yield Parameters:

  • _self (Object)

    the object that the method was called on



18
19
20
21
# File 'lib/mutate.rb', line 18

def perform
  yield self
  self
end

#tossObject



10
11
12
# File 'lib/mutate.rb', line 10

def toss
  if yield self ; nil ; else ; self ; end
end