Class: ClippingsPluck::Clipping
- Inherits:
-
Hash
- Object
- Hash
- ClippingsPluck::Clipping
- Defined in:
- lib/clippings_pluck/clipping.rb
Instance Method Summary collapse
- #eligible_for_note_attachment?(note_location) ⇒ Boolean
- #has_location? ⇒ Boolean
- #location=(location) ⇒ Object
- #missing_location? ⇒ Boolean
- #normalized_location ⇒ Object
- #notated? ⇒ Boolean
Instance Method Details
#eligible_for_note_attachment?(note_location) ⇒ Boolean
11 12 13 |
# File 'lib/clippings_pluck/clipping.rb', line 11 def (note_location) has_location? && normalized_location <= note_location end |
#has_location? ⇒ Boolean
23 24 25 |
# File 'lib/clippings_pluck/clipping.rb', line 23 def has_location? !missing_location? end |
#location=(location) ⇒ Object
3 4 5 |
# File 'lib/clippings_pluck/clipping.rb', line 3 def location=(location) self[:location] = Location.new(location) end |
#missing_location? ⇒ Boolean
19 20 21 |
# File 'lib/clippings_pluck/clipping.rb', line 19 def missing_location? self[:location].nil? end |
#normalized_location ⇒ Object
7 8 9 |
# File 'lib/clippings_pluck/clipping.rb', line 7 def normalized_location missing_location? ? nil : self[:location].normalize end |
#notated? ⇒ Boolean
15 16 17 |
# File 'lib/clippings_pluck/clipping.rb', line 15 def notated? !self[:note].nil? end |