Class: UrlParser::OptionSetter
- Inherits:
-
Object
- Object
- UrlParser::OptionSetter
show all
- Defined in:
- lib/url_parser/option_setter.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(options = {}, &blk) ⇒ OptionSetter
Returns a new instance of OptionSetter.
8
9
10
11
|
# File 'lib/url_parser/option_setter.rb', line 8
def initialize(options = {}, &blk)
@options = options
@blk = blk
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(*args) ⇒ Object
42
43
44
|
# File 'lib/url_parser/option_setter.rb', line 42
def method_missing(*args)
end
|
Instance Attribute Details
#blk ⇒ Object
Returns the value of attribute blk.
4
5
6
|
# File 'lib/url_parser/option_setter.rb', line 4
def blk
@blk
end
|
#options ⇒ Object
Returns the value of attribute options.
6
7
8
|
# File 'lib/url_parser/option_setter.rb', line 6
def options
@options
end
|
Instance Method Details
#canonicalize! ⇒ Object
21
22
23
|
# File 'lib/url_parser/option_setter.rb', line 21
def canonicalize!
options[:canonicalize] = true
end
|
#clean! ⇒ Object
29
30
31
32
33
34
|
# File 'lib/url_parser/option_setter.rb', line 29
def clean!
unescape!
unembed!
canonicalize!
normalize!
end
|
#normalize! ⇒ Object
25
26
27
|
# File 'lib/url_parser/option_setter.rb', line 25
def normalize!
options[:normalize] = true
end
|
#to_hash ⇒ Object
Also known as:
to_h
36
37
38
39
|
# File 'lib/url_parser/option_setter.rb', line 36
def to_hash
blk.call(self) if blk
self.options
end
|
#unembed! ⇒ Object
17
18
19
|
# File 'lib/url_parser/option_setter.rb', line 17
def unembed!
options[:unembed] = true
end
|
#unescape! ⇒ Object
13
14
15
|
# File 'lib/url_parser/option_setter.rb', line 13
def unescape!
options[:unescape] = true
end
|