Class: YelpHtmlParser::Helpers::SecondaryAttributesParser

Inherits:
Object
  • Object
show all
Defined in:
lib/yelp_html_parser/helpers/secondary_attributes_parser.rb

Instance Method Summary collapse

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

#parseObject



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