Class: HtmlSlicer::Options
- Inherits:
-
Object
- Object
- HtmlSlicer::Options
- Defined in:
- lib/html_slicer/options.rb
Overview
Make options adjective and convinient for processing needs.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#except ⇒ Object
readonly
Superclass.
-
#only ⇒ Object
readonly
Superclass.
Instance Method Summary collapse
- #hexdigest ⇒ Object
-
#initialize(options) ⇒ Options
constructor
A new instance of Options.
- #string_value ⇒ Object
Constructor Details
#initialize(options) ⇒ Options
Returns a new instance of Options.
11 12 13 14 15 |
# File 'lib/html_slicer/options.rb', line 11 def initialize() ||= {} @only = [:only] @except = [:except] end |
Instance Attribute Details
#except ⇒ Object (readonly)
Superclass
9 10 11 |
# File 'lib/html_slicer/options.rb', line 9 def except @except end |
#only ⇒ Object (readonly)
Superclass
9 10 11 |
# File 'lib/html_slicer/options.rb', line 9 def only @only end |
Instance Method Details
#hexdigest ⇒ Object
17 18 19 |
# File 'lib/html_slicer/options.rb', line 17 def hexdigest Digest::SHA1.hexdigest(string_value) end |
#string_value ⇒ Object
21 22 23 |
# File 'lib/html_slicer/options.rb', line 21 def string_value instance_variables.map {|name| name.to_s + ":" + instance_variable_get(name).to_s}.join end |