Class: Lbp::ParagraphImage

Inherits:
Object
  • Object
show all
Defined in:
lib/lbp/paragraph_image.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(paragraphurl, position = 1) ⇒ ParagraphImage

def initialize(confighash, filehash, pid, position=1)



9
10
11
12
13
# File 'lib/lbp/paragraph_image.rb', line 9

def initialize(paragraphurl, position=1)
  @query = Query.new();
  @results = @query.zone_info("<" + paragraphurl + ">")
  @zone_index = position - 1
end

Instance Attribute Details

#pidObject (readonly)

Returns the value of attribute pid.



6
7
8
# File 'lib/lbp/paragraph_image.rb', line 6

def pid
  @pid
end

Instance Method Details

#canvasObject



35
36
37
# File 'lib/lbp/paragraph_image.rb', line 35

def canvas
  return @results[@zone_index][:canvasurl].to_s.split("/").last
end

#heightObject



29
30
31
# File 'lib/lbp/paragraph_image.rb', line 29

def height
  return @results[@zone_index][:height].to_s.to_i
end

#lrxObject



20
21
22
# File 'lib/lbp/paragraph_image.rb', line 20

def lrx
  return @results[@zone_index][:lrx].to_s.to_i
end

#lryObject



23
24
25
# File 'lib/lbp/paragraph_image.rb', line 23

def lry
  return @results[@zone_index][:lry].to_s.to_i
end

#ulxObject



14
15
16
# File 'lib/lbp/paragraph_image.rb', line 14

def ulx
  return @results[@zone_index][:ulx].to_s.to_i
end

#ulyObject



17
18
19
# File 'lib/lbp/paragraph_image.rb', line 17

def uly
  return @results[@zone_index][:uly].to_s.to_i
end

#urlObject



32
33
34
# File 'lib/lbp/paragraph_image.rb', line 32

def url
  return @results[@zone_index][:canvasurl].to_s.split("/").last + ".jpg"
end

#widthObject



26
27
28
# File 'lib/lbp/paragraph_image.rb', line 26

def width
  return @results[@zone_index][:width].to_s.to_i
end