Module: XMLable::Mixins::Wrapper

Defined in:
lib/xmlable/mixins/wrapper.rb

Overview

Wrapper module contains methods to wrap the primitive classes

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(*args, &block) ⇒ Object



7
8
9
# File 'lib/xmlable/mixins/wrapper.rb', line 7

def method_missing(*args, &block)
  __object.send(*args, &block)
end

Instance Method Details

#inspectString

Returns:

  • (String)


32
33
34
# File 'lib/xmlable/mixins/wrapper.rb', line 32

def inspect
  "[Wrapper(#{__object.class})] #{__object.inspect}"
end

#is_a?(klass) ⇒ Boolean

Is wrapped class inherits from given class?

Parameters:

  • klass (Class)
  • (Boolean)

Returns:

  • (Boolean)


25
26
27
# File 'lib/xmlable/mixins/wrapper.rb', line 25

def is_a?(klass)
  __object.is_a?(klass)
end

#to_s(*args) ⇒ String

Returns:

  • (String)


14
15
16
# File 'lib/xmlable/mixins/wrapper.rb', line 14

def to_s(*args)
  __object.to_s(*args)
end