Class: RubyMarks::Group
- Inherits:
-
Object
- Object
- RubyMarks::Group
- Defined in:
- lib/ruby_marks/group.rb
Instance Attribute Summary collapse
-
#block_height_tolerance ⇒ Object
Returns the value of attribute block_height_tolerance.
-
#block_width_tolerance ⇒ Object
Returns the value of attribute block_width_tolerance.
-
#coordinates ⇒ Object
Returns the value of attribute coordinates.
-
#distance_between_marks ⇒ Object
Returns the value of attribute distance_between_marks.
-
#expected_coordinates ⇒ Object
Returns the value of attribute expected_coordinates.
-
#expected_lines ⇒ Object
Returns the value of attribute expected_lines.
-
#label ⇒ Object
readonly
Returns the value of attribute label.
-
#mark_height ⇒ Object
Returns the value of attribute mark_height.
-
#mark_height_tolerance ⇒ Object
Returns the value of attribute mark_height_tolerance.
-
#mark_width ⇒ Object
Returns the value of attribute mark_width.
-
#mark_width_tolerance ⇒ Object
Returns the value of attribute mark_width_tolerance.
-
#marks ⇒ Object
Returns the value of attribute marks.
-
#marks_options ⇒ Object
Returns the value of attribute marks_options.
-
#recognizer ⇒ Object
readonly
Returns the value of attribute recognizer.
Instance Method Summary collapse
- #incorrect_expected_lines ⇒ Object
-
#initialize(label, recognizer) {|_self| ... } ⇒ Group
constructor
A new instance of Group.
- #mark_height_tolerance_range ⇒ Object
- #mark_height_with_down_tolerance ⇒ Object
- #mark_height_with_up_tolerance ⇒ Object
- #mark_width_tolerance_range ⇒ Object
- #mark_width_with_down_tolerance ⇒ Object
- #mark_width_with_up_tolerance ⇒ Object
Constructor Details
#initialize(label, recognizer) {|_self| ... } ⇒ Group
Returns a new instance of Group.
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/ruby_marks/group.rb', line 10 def initialize(label, recognizer) @label = label @recognizer = recognizer @block_width_tolerance = @recognizer.config.default_block_width_tolerance @block_height_tolerance = @recognizer.config.default_block_height_tolerance @mark_width = @recognizer.config.default_mark_width @mark_height = @recognizer.config.default_mark_height @mark_width_tolerance = @recognizer.config.default_mark_width_tolerance @mark_height_tolerance = @recognizer.config.default_mark_height_tolerance @marks_options = @recognizer.config. @distance_between_marks = @recognizer.config.default_distance_between_marks @expected_lines = @recognizer.config.default_expected_lines @expected_coordinates = {} yield self if block_given? end |
Instance Attribute Details
#block_height_tolerance ⇒ Object
Returns the value of attribute block_height_tolerance.
6 7 8 |
# File 'lib/ruby_marks/group.rb', line 6 def block_height_tolerance @block_height_tolerance end |
#block_width_tolerance ⇒ Object
Returns the value of attribute block_width_tolerance.
6 7 8 |
# File 'lib/ruby_marks/group.rb', line 6 def block_width_tolerance @block_width_tolerance end |
#coordinates ⇒ Object
Returns the value of attribute coordinates.
6 7 8 |
# File 'lib/ruby_marks/group.rb', line 6 def coordinates @coordinates end |
#distance_between_marks ⇒ Object
Returns the value of attribute distance_between_marks.
6 7 8 |
# File 'lib/ruby_marks/group.rb', line 6 def distance_between_marks @distance_between_marks end |
#expected_coordinates ⇒ Object
Returns the value of attribute expected_coordinates.
6 7 8 |
# File 'lib/ruby_marks/group.rb', line 6 def expected_coordinates @expected_coordinates end |
#expected_lines ⇒ Object
Returns the value of attribute expected_lines.
6 7 8 |
# File 'lib/ruby_marks/group.rb', line 6 def expected_lines @expected_lines end |
#label ⇒ Object (readonly)
Returns the value of attribute label.
5 6 7 |
# File 'lib/ruby_marks/group.rb', line 5 def label @label end |
#mark_height ⇒ Object
Returns the value of attribute mark_height.
6 7 8 |
# File 'lib/ruby_marks/group.rb', line 6 def mark_height @mark_height end |
#mark_height_tolerance ⇒ Object
Returns the value of attribute mark_height_tolerance.
6 7 8 |
# File 'lib/ruby_marks/group.rb', line 6 def mark_height_tolerance @mark_height_tolerance end |
#mark_width ⇒ Object
Returns the value of attribute mark_width.
6 7 8 |
# File 'lib/ruby_marks/group.rb', line 6 def mark_width @mark_width end |
#mark_width_tolerance ⇒ Object
Returns the value of attribute mark_width_tolerance.
6 7 8 |
# File 'lib/ruby_marks/group.rb', line 6 def mark_width_tolerance @mark_width_tolerance end |
#marks ⇒ Object
Returns the value of attribute marks.
6 7 8 |
# File 'lib/ruby_marks/group.rb', line 6 def marks @marks end |
#marks_options ⇒ Object
Returns the value of attribute marks_options.
6 7 8 |
# File 'lib/ruby_marks/group.rb', line 6 def @marks_options end |
#recognizer ⇒ Object (readonly)
Returns the value of attribute recognizer.
5 6 7 |
# File 'lib/ruby_marks/group.rb', line 5 def recognizer @recognizer end |
Instance Method Details
#incorrect_expected_lines ⇒ Object
32 33 34 |
# File 'lib/ruby_marks/group.rb', line 32 def incorrect_expected_lines @expected_lines != marks.count end |
#mark_height_tolerance_range ⇒ Object
61 62 63 |
# File 'lib/ruby_marks/group.rb', line 61 def mark_height_tolerance_range mark_height_with_down_tolerance..mark_height_with_up_tolerance end |
#mark_height_with_down_tolerance ⇒ Object
46 47 48 |
# File 'lib/ruby_marks/group.rb', line 46 def mark_height_with_down_tolerance @mark_height - @mark_height_tolerance end |
#mark_height_with_up_tolerance ⇒ Object
51 52 53 |
# File 'lib/ruby_marks/group.rb', line 51 def mark_height_with_up_tolerance @mark_height + @mark_height_tolerance end |
#mark_width_tolerance_range ⇒ Object
56 57 58 |
# File 'lib/ruby_marks/group.rb', line 56 def mark_width_tolerance_range mark_width_with_down_tolerance..mark_width_with_up_tolerance end |
#mark_width_with_down_tolerance ⇒ Object
36 37 38 |
# File 'lib/ruby_marks/group.rb', line 36 def mark_width_with_down_tolerance @mark_width - @mark_width_tolerance end |
#mark_width_with_up_tolerance ⇒ Object
41 42 43 |
# File 'lib/ruby_marks/group.rb', line 41 def mark_width_with_up_tolerance @mark_width + @mark_width_tolerance end |