Module: AWS::Core::MetaUtils

Defined in:
lib/aws/core/meta_utils.rb

Class Method Summary collapse

Class Method Details

.class_extend_method(klass, name, &block) ⇒ Object


29
30
31
32
33
34
35
# File 'lib/aws/core/meta_utils.rb', line 29

def class_extend_method(klass, name, &block)
  klass.send(:include,
    Module.new do
     define_method(name, &block)
    end
  )
end

.extend(object, &block) ⇒ Object


38
39
40
# File 'lib/aws/core/meta_utils.rb', line 38

def extend(object, &block)
  object.extend(Module.new(&block))
end

.extend_method(object, name, &block) ⇒ Object


20
21
22
23
24
25
26
# File 'lib/aws/core/meta_utils.rb', line 20

def extend_method(object, name, &block)
  object.extend(
    Module.new do
      define_method(name, &block)
    end
  )
end