Class: YelpHtmlParser::Helpers::SecondaryAttributesParser
- Inherits:
-
Object
- Object
- YelpHtmlParser::Helpers::SecondaryAttributesParser
- Defined in:
- lib/yelp_html_parser/helpers/secondary_attributes_parser.rb
Instance Method Summary collapse
-
#initialize(attribute) ⇒ SecondaryAttributesParser
constructor
A new instance of SecondaryAttributesParser.
- #parse ⇒ Object
Constructor Details
#initialize(attribute) ⇒ SecondaryAttributesParser
Returns a new instance of SecondaryAttributesParser.
4 5 6 |
# File 'lib/yelp_html_parser/helpers/secondary_attributes_parser.rb', line 4 def initialize(attribute) @attribute = attribute end |
Instance Method Details
#parse ⇒ Object
8 9 10 11 |
# File 'lib/yelp_html_parser/helpers/secondary_attributes_parser.rb', line 8 def parse result = /(?:[^\n\s]).*(?=\n)/.match(@attribute).to_s result.gsub("<br>",", ") end |