Class: Thumbnailer::Parser

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(url) ⇒ Parser

Returns a new instance of Parser.



5
6
7
8
9
10
11
12
13
# File 'lib/thumbnailer/parser.rb', line 5

def initialize(url)
  @uri = URI.parse(url)

  SITES.each {|k, w|
    if url =~ /#{k}/
      @worker = w.new(@uri)
    end
  }
end

Instance Attribute Details

#uriObject (readonly)

Returns the value of attribute uri.



3
4
5
# File 'lib/thumbnailer/parser.rb', line 3

def uri
  @uri
end

#workerObject (readonly)

Returns the value of attribute worker.



3
4
5
# File 'lib/thumbnailer/parser.rb', line 3

def worker
  @worker
end