Class: Rubyword::Element::Base
- Inherits:
-
Object
- Object
- Rubyword::Element::Base
- Defined in:
- lib/rubyword/element/base.rb
Instance Attribute Summary collapse
-
#rubyword ⇒ Object
Returns the value of attribute rubyword.
-
#section ⇒ Object
Returns the value of attribute section.
Instance Method Summary collapse
-
#filter_text(text) ⇒ Object
filter html special char.
-
#initialize(rubyword, section = nil) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(rubyword, section = nil) ⇒ Base
Returns a new instance of Base.
6 7 8 9 |
# File 'lib/rubyword/element/base.rb', line 6 def initialize(rubyword, section=nil) @rubyword = rubyword @section = section end |
Instance Attribute Details
#rubyword ⇒ Object
Returns the value of attribute rubyword.
5 6 7 |
# File 'lib/rubyword/element/base.rb', line 5 def rubyword @rubyword end |
#section ⇒ Object
Returns the value of attribute section.
5 6 7 |
# File 'lib/rubyword/element/base.rb', line 5 def section @section end |
Instance Method Details
#filter_text(text) ⇒ Object
filter html special char
12 13 14 15 16 17 18 19 20 |
# File 'lib/rubyword/element/base.rb', line 12 def filter_text(text) text = text.to_s text.gsub('&', '&') text.gsub('\'', ''') text.gsub('"', '"') text.gsub('<', '<') text.gsub('>', '>') text end |