Class: Proc::Callback

Inherits:
Struct
  • Object
show all
Defined in:
lib/deltacloud/core_ext/proc.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name) ⇒ Object



22
23
24
# File 'lib/deltacloud/core_ext/proc.rb', line 22

def method_missing(name, *)
  name == :"#{called}?" || (name == called && block_given? && yield(*args))
end

Instance Attribute Details

#argsObject

Returns the value of attribute args



21
22
23
# File 'lib/deltacloud/core_ext/proc.rb', line 21

def args
  @args
end

#calledObject

Returns the value of attribute called



21
22
23
# File 'lib/deltacloud/core_ext/proc.rb', line 21

def called
  @called
end