Class: MethodDelegationTest::TestDelegate

Inherits:
Object
  • Object
show all
Defined in:
lib/puppet/vendor/rgen/test/method_delegation_test.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#callcountObject

Returns the value of attribute callcount.



10
11
12
# File 'lib/puppet/vendor/rgen/test/method_delegation_test.rb', line 10

def callcount
  @callcount
end

#modeObject

Returns the value of attribute mode.



10
11
12
# File 'lib/puppet/vendor/rgen/test/method_delegation_test.rb', line 10

def mode
  @mode
end

Instance Method Details

#common_delegated(delegator) ⇒ Object Also known as: to_s_delegated, methodInSingleton_delegated, class_delegated, artificialMethod_delegated



11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/puppet/vendor/rgen/test/method_delegation_test.rb', line 11

def common_delegated(delegator)
  @callcount ||= 0
  @callcount += 1
  case @mode 
    when :continue
      throw :continue
    when :delegatorId
      delegator.object_id
    when :return7
      7
  end
end