Class: Cejo::Media::Parser

Inherits:
Object
  • Object
show all
Defined in:
lib/cejo/media/get/parser.rb

Overview

Parse information using grabber

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(current, url) ⇒ Parser

Returns a new instance of Parser.



12
13
14
15
# File 'lib/cejo/media/get/parser.rb', line 12

def initialize(current, url)
  @current = current
  @url = url
end

Instance Attribute Details

#currentObject (readonly)

Returns the value of attribute current.



9
10
11
# File 'lib/cejo/media/get/parser.rb', line 9

def current
  @current
end

#fmtObject

Returns the value of attribute fmt.



10
11
12
# File 'lib/cejo/media/get/parser.rb', line 10

def fmt
  @fmt
end

#urlObject (readonly)

Returns the value of attribute url.



9
10
11
# File 'lib/cejo/media/get/parser.rb', line 9

def url
  @url
end

Instance Method Details

#baseObject



21
22
23
# File 'lib/cejo/media/get/parser.rb', line 21

def base
  "#{current.name} #{current.parser} '#{new_format}' #{url}"
end

#new_formatObject



17
18
19
# File 'lib/cejo/media/get/parser.rb', line 17

def new_format
  current.send fmt.to_sym
end

#resultObject



25
26
27
# File 'lib/cejo/media/get/parser.rb', line 25

def result
  `""#{base}""`.strip
end