Class: TidyFFI::OptionsContainer::Proxy

Inherits:
Object
  • Object
show all
Defined in:
lib/tidy_ffi/options_container.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(obj, options1, options2) ⇒ Proxy

Returns a new instance of Proxy.



71
72
73
74
75
# File 'lib/tidy_ffi/options_container.rb', line 71

def initialize(obj, options1, options2)
  @obj = obj
  @options = TidyFFI::OptionsContainer.new(options1)
  @options.merge_with_options(options2)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(meth, *args) ⇒ Object



86
87
88
# File 'lib/tidy_ffi/options_container.rb', line 86

def method_missing(meth, *args)
  @obj.send(meth, *args)
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



61
62
63
# File 'lib/tidy_ffi/options_container.rb', line 61

def options
  @options
end

Instance Method Details

#clean(str, opts = {}) ⇒ Object



67
68
69
# File 'lib/tidy_ffi/options_container.rb', line 67

def clean(str, opts = {})
  @obj.clean(str, options.to_hash!.merge(opts))
end

#clear!Object



81
82
83
84
# File 'lib/tidy_ffi/options_container.rb', line 81

def clear!
  @options.clear!
  self
end

#with_options(options) ⇒ Object



77
78
79
# File 'lib/tidy_ffi/options_container.rb', line 77

def with_options(options)
  Proxy.new(@obj, @options, options)
end