Class: RubyMarks::Group
- Inherits:
-
Object
- Object
- RubyMarks::Group
- Defined in:
- lib/ruby_marks/group.rb
Instance Attribute Summary collapse
-
#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.
-
#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 |
# File 'lib/ruby_marks/group.rb', line 10 def initialize(label, recognizer) @label = label @recognizer = recognizer @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
#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 |
#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
29 30 31 |
# File 'lib/ruby_marks/group.rb', line 29 def incorrect_expected_lines @expected_lines != marks.count end |
#mark_height_tolerance_range ⇒ Object
58 59 60 |
# File 'lib/ruby_marks/group.rb', line 58 def mark_height_tolerance_range mark_height_with_down_tolerance..mark_height_with_up_tolerance end |
#mark_height_with_down_tolerance ⇒ Object
43 44 45 |
# File 'lib/ruby_marks/group.rb', line 43 def mark_height_with_down_tolerance @mark_height - @mark_height_tolerance end |
#mark_height_with_up_tolerance ⇒ Object
48 49 50 |
# File 'lib/ruby_marks/group.rb', line 48 def mark_height_with_up_tolerance @mark_height + @mark_height_tolerance end |
#mark_width_tolerance_range ⇒ Object
53 54 55 |
# File 'lib/ruby_marks/group.rb', line 53 def mark_width_tolerance_range mark_width_with_down_tolerance..mark_width_with_up_tolerance end |
#mark_width_with_down_tolerance ⇒ Object
33 34 35 |
# File 'lib/ruby_marks/group.rb', line 33 def mark_width_with_down_tolerance @mark_width - @mark_width_tolerance end |
#mark_width_with_up_tolerance ⇒ Object
38 39 40 |
# File 'lib/ruby_marks/group.rb', line 38 def mark_width_with_up_tolerance @mark_width + @mark_width_tolerance end |