Module: Runaround::InstanceMethods

Defined in:
lib/runaround/instance_methods.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.extended(into) ⇒ Object



9
10
11
12
13
14
15
# File 'lib/runaround/instance_methods.rb', line 9

def self.extended(into)
  into.extend Runaround
  into.include Runaround
  into.runaround.after(:new) do |mc|
    mc.return_value.runaround.import(into.runaround_instance_methods)
  end
end

.included(into) ⇒ Object

Raises:

  • (RuntimeError)


4
5
6
7
# File 'lib/runaround/instance_methods.rb', line 4

def self.included(into)
  raise RuntimeError,
    "Runaround::InstanceMethods expects to be extended, not included"
end

Instance Method Details

#irunaroundObject



22
23
24
25
26
# File 'lib/runaround/instance_methods.rb', line 22

def irunaround
  runaround_instance_methods.tap do |x|
    yield(x) if block_given?
  end
end

#runaround_instance_methodsObject



17
18
19
20
# File 'lib/runaround/instance_methods.rb', line 17

def runaround_instance_methods
  @runaround_instance_methods ||= Manager.new(
    self, apply: false, for_instances: true)
end