Class: NokogiriString
- Inherits:
-
Object
- Object
- NokogiriString
- Defined in:
- lib/mason_helper.rb
Instance Attribute Summary collapse
-
#nokogiri ⇒ Object
readonly
Returns the value of attribute nokogiri.
Instance Method Summary collapse
- #bytesize ⇒ Object
-
#initialize(nokogiri) ⇒ NokogiriString
constructor
A new instance of NokogiriString.
-
#kind_of?(what) ⇒ Boolean
A NokogiriString is not really a String, but is good enought in the Rack context to act like one.
- #to_s ⇒ Object
- #to_str ⇒ Object
Constructor Details
#initialize(nokogiri) ⇒ NokogiriString
Returns a new instance of NokogiriString.
4 5 6 |
# File 'lib/mason_helper.rb', line 4 def initialize(nokogiri) @nokogiri = nokogiri end |
Instance Attribute Details
#nokogiri ⇒ Object (readonly)
Returns the value of attribute nokogiri.
2 3 4 |
# File 'lib/mason_helper.rb', line 2 def nokogiri @nokogiri end |
Instance Method Details
#bytesize ⇒ Object
19 20 21 |
# File 'lib/mason_helper.rb', line 19 def bytesize to_str.bytesize end |
#kind_of?(what) ⇒ Boolean
A NokogiriString is not really a String, but is good enought in the Rack context to act like one.
10 11 12 13 |
# File 'lib/mason_helper.rb', line 10 def kind_of?(what) return true if what == String super end |
#to_s ⇒ Object
23 24 25 |
# File 'lib/mason_helper.rb', line 23 def to_s to_str end |
#to_str ⇒ Object
15 16 17 |
# File 'lib/mason_helper.rb', line 15 def to_str @to_str ||= @nokogiri.to_s end |