Class: RubyPager::Text_Line
- Inherits:
-
Object
- Object
- RubyPager::Text_Line
- Defined in:
- lib/ruby_pager/text_line.rb
Instance Attribute Summary collapse
-
#baseline ⇒ Object
readonly
Returns the value of attribute baseline.
-
#contour ⇒ Object
readonly
Returns the value of attribute contour.
-
#id ⇒ Object
Returns the value of attribute id.
-
#index ⇒ Object
Returns the value of attribute index.
-
#text ⇒ Object
Returns the value of attribute text.
Class Method Summary collapse
Instance Method Summary collapse
- #baseline_vertical_noise(ex_std_dev) ⇒ Object
- #get_consolidated_data ⇒ Object
-
#initialize(ex_index, ex_data) ⇒ Text_Line
constructor
A new instance of Text_Line.
Constructor Details
#initialize(ex_index, ex_data) ⇒ Text_Line
Returns a new instance of Text_Line.
6 7 8 9 10 11 12 13 |
# File 'lib/ruby_pager/text_line.rb', line 6 def initialize(ex_index, ex_data) @data=ex_data @index=ex_index @id = @data["@id"] @text = @data["TextEquiv"]["Unicode"] load_coords() load_baseline() end |
Instance Attribute Details
#baseline ⇒ Object (readonly)
Returns the value of attribute baseline.
5 6 7 |
# File 'lib/ruby_pager/text_line.rb', line 5 def baseline @baseline end |
#contour ⇒ Object (readonly)
Returns the value of attribute contour.
5 6 7 |
# File 'lib/ruby_pager/text_line.rb', line 5 def contour @contour end |
#id ⇒ Object
Returns the value of attribute id.
5 6 7 |
# File 'lib/ruby_pager/text_line.rb', line 5 def id @id end |
#index ⇒ Object
Returns the value of attribute index.
5 6 7 |
# File 'lib/ruby_pager/text_line.rb', line 5 def index @index end |
#text ⇒ Object
Returns the value of attribute text.
5 6 7 |
# File 'lib/ruby_pager/text_line.rb', line 5 def text @text end |
Class Method Details
.blank ⇒ Object
15 16 17 |
# File 'lib/ruby_pager/text_line.rb', line 15 def self.blank return Text_Line.new(0,Text_Line.blank_data) end |
.blank_data ⇒ Object
43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/ruby_pager/text_line.rb', line 43 def self.blank_data res=Hash.new res["@id"]="" res["TextEquiv"]=Hash.new res["TextEquiv"]["Unicode"]="" res["Baseline"]=Hash.new res["Baseline"]["@points"]=Coords.blank_data res["Coords"]=Hash.new res["Coords"]["@points"]=Coords.blank_data return res end |
Instance Method Details
#baseline_vertical_noise(ex_std_dev) ⇒ Object
39 40 41 |
# File 'lib/ruby_pager/text_line.rb', line 39 def baseline_vertical_noise(ex_std_dev) @baseline.vertical_noise(ex_std_dev) end |
#get_consolidated_data ⇒ Object
34 35 36 37 |
# File 'lib/ruby_pager/text_line.rb', line 34 def get_consolidated_data consolidate_data() return @data end |