Class: Ungarbled::Encoder

Inherits:
Object
  • Object
show all
Defined in:
lib/ungarbled/encoder.rb,
lib/ungarbled/encoder/ja.rb,
lib/ungarbled/encoder/base.rb

Defined Under Namespace

Classes: Base, Ja

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(browser, options = {}) ⇒ Encoder

Returns a new instance of Encoder.



9
10
11
12
13
# File 'lib/ungarbled/encoder.rb', line 9

def initialize(browser, options = {})
  @browser = browser
  @encoder_options = options.dup
  self.lang = @encoder_options.delete(:lang) || :base
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args) ⇒ Object



26
27
28
# File 'lib/ungarbled/encoder.rb', line 26

def method_missing(name, *args)
  @delegate.send name, *args
end

Instance Attribute Details

#delegateObject

Returns the value of attribute delegate.



15
16
17
# File 'lib/ungarbled/encoder.rb', line 15

def delegate
  @delegate
end

#langObject

Returns the value of attribute lang.



15
16
17
# File 'lib/ungarbled/encoder.rb', line 15

def lang
  @lang
end