Class: UrlParser

Inherits:
Object
  • Object
show all
Defined in:
lib/parser/url_parser.rb

Instance Method Summary collapse

Constructor Details

#initialize(url) ⇒ UrlParser

Returns a new instance of UrlParser.



6
7
8
# File 'lib/parser/url_parser.rb', line 6

def initialize(url)
  @url = url
end

Instance Method Details

#parseObject



10
11
12
13
14
15
16
17
18
# File 'lib/parser/url_parser.rb', line 10

def parse
  content = ""
  open(@url) do |file| 
    file.each_line do |line|
      content << line
    end
  end
  JSON.parse(content[16..-1])["payload"]
end