Class: RubyMarks::Group
- Inherits:
-
Object
- Object
- RubyMarks::Group
- Defined in:
- lib/ruby_marks/group.rb
Instance Attribute Summary collapse
-
#clocks_range ⇒ Object
Returns the value of attribute clocks_range.
-
#distance_between_marks ⇒ Object
Returns the value of attribute distance_between_marks.
-
#label ⇒ Object
readonly
Returns the value of attribute label.
-
#mark_height ⇒ Object
Returns the value of attribute mark_height.
-
#mark_width ⇒ Object
Returns the value of attribute mark_width.
-
#marks_options ⇒ Object
Returns the value of attribute marks_options.
-
#recognizer ⇒ Object
readonly
Returns the value of attribute recognizer.
-
#x_distance_from_clock ⇒ Object
Returns the value of attribute x_distance_from_clock.
Instance Method Summary collapse
- #belongs_to_clock?(clock) ⇒ Boolean
-
#initialize(label, recognizer) {|_self| ... } ⇒ Group
constructor
A new instance of Group.
Constructor Details
#initialize(label, recognizer) {|_self| ... } ⇒ Group
Returns a new instance of Group.
10 11 12 13 14 15 16 17 18 19 20 |
# 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 @marks_options = @recognizer.config. @distance_between_marks = @recognizer.config.default_distance_between_marks @x_distance_from_clock = 0 @clocks_range = 0..0 yield self if block_given? end |
Instance Attribute Details
#clocks_range ⇒ Object
Returns the value of attribute clocks_range.
5 6 7 |
# File 'lib/ruby_marks/group.rb', line 5 def clocks_range @clocks_range end |
#distance_between_marks ⇒ Object
Returns the value of attribute distance_between_marks.
7 8 9 |
# File 'lib/ruby_marks/group.rb', line 7 def distance_between_marks @distance_between_marks 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.
7 8 9 |
# File 'lib/ruby_marks/group.rb', line 7 def mark_height @mark_height end |
#mark_width ⇒ Object
Returns the value of attribute mark_width.
7 8 9 |
# File 'lib/ruby_marks/group.rb', line 7 def mark_width @mark_width end |
#marks_options ⇒ Object
Returns the value of attribute marks_options.
7 8 9 |
# File 'lib/ruby_marks/group.rb', line 7 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 |
#x_distance_from_clock ⇒ Object
Returns the value of attribute x_distance_from_clock.
7 8 9 |
# File 'lib/ruby_marks/group.rb', line 7 def x_distance_from_clock @x_distance_from_clock end |
Instance Method Details
#belongs_to_clock?(clock) ⇒ Boolean
27 28 29 30 31 |
# File 'lib/ruby_marks/group.rb', line 27 def belongs_to_clock?(clock) if @clocks_range.is_a?(Range) return @clocks_range.include? clock end end |