Class: Lbp::ParagraphImage
- Inherits:
-
Object
- Object
- Lbp::ParagraphImage
- Defined in:
- lib/lbp/paragraph_image.rb
Instance Attribute Summary collapse
-
#pid ⇒ Object
readonly
Returns the value of attribute pid.
Instance Method Summary collapse
- #canvas ⇒ Object
- #height ⇒ Object
-
#initialize(paragraphurl, position = 1) ⇒ ParagraphImage
constructor
def initialize(confighash, filehash, pid, position=1).
- #lrx ⇒ Object
- #lry ⇒ Object
- #ulx ⇒ Object
- #uly ⇒ Object
- #url ⇒ Object
- #width ⇒ Object
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
#pid ⇒ Object (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
#canvas ⇒ Object
35 36 37 |
# File 'lib/lbp/paragraph_image.rb', line 35 def canvas return @results[@zone_index][:canvasurl].to_s.split("/").last end |
#height ⇒ Object
29 30 31 |
# File 'lib/lbp/paragraph_image.rb', line 29 def height return @results[@zone_index][:height].to_s.to_i end |
#lrx ⇒ Object
20 21 22 |
# File 'lib/lbp/paragraph_image.rb', line 20 def lrx return @results[@zone_index][:lrx].to_s.to_i end |
#lry ⇒ Object
23 24 25 |
# File 'lib/lbp/paragraph_image.rb', line 23 def lry return @results[@zone_index][:lry].to_s.to_i end |
#ulx ⇒ Object
14 15 16 |
# File 'lib/lbp/paragraph_image.rb', line 14 def ulx return @results[@zone_index][:ulx].to_s.to_i end |
#uly ⇒ Object
17 18 19 |
# File 'lib/lbp/paragraph_image.rb', line 17 def uly return @results[@zone_index][:uly].to_s.to_i end |
#url ⇒ Object
32 33 34 |
# File 'lib/lbp/paragraph_image.rb', line 32 def url return @results[@zone_index][:canvasurl].to_s.split("/").last + ".jpg" end |
#width ⇒ Object
26 27 28 |
# File 'lib/lbp/paragraph_image.rb', line 26 def width return @results[@zone_index][:width].to_s.to_i end |