Module: Aranha::Parsers::Ofx::BodyParser::NodeExtension
- Defined in:
- lib/aranha/parsers/ofx/body_parser/node_extension.rb
Instance Method Summary collapse
- #collect(&block) ⇒ Object
- #inner_text(*args) ⇒ Object (also: #text)
- #normalize_text(text) ⇒ Object
- #prepend_extension(object) ⇒ Object
- #search(*args) ⇒ Object (also: #/)
Instance Method Details
#collect(&block) ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/aranha/parsers/ofx/body_parser/node_extension.rb', line 10 def collect(&block) r = [] each do |e| r << block.call(prepend_extension(e)) end r end |
#inner_text(*args) ⇒ Object Also known as: text
18 19 20 |
# File 'lib/aranha/parsers/ofx/body_parser/node_extension.rb', line 18 def inner_text(*args) normalize_text(super) end |
#normalize_text(text) ⇒ Object
29 30 31 |
# File 'lib/aranha/parsers/ofx/body_parser/node_extension.rb', line 29 def normalize_text(text) text.gsub(/\s+/, ' ').strip end |
#prepend_extension(object) ⇒ Object
24 25 26 27 |
# File 'lib/aranha/parsers/ofx/body_parser/node_extension.rb', line 24 def prepend_extension(object) object.singleton_class.prepend(::Aranha::Parsers::Ofx::BodyParser::NodeExtension) object end |
#search(*args) ⇒ Object Also known as: /
33 34 35 |
# File 'lib/aranha/parsers/ofx/body_parser/node_extension.rb', line 33 def search(*args) prepend_extension(super) end |