Class: Benelux::Mark
- Inherits:
-
Time
- Object
- Time
- Benelux::Mark
- Includes:
- TagHelpers
- Defined in:
- lib/benelux/mark.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
Attributes included from TagHelpers
Class Method Summary collapse
Instance Method Summary collapse
- #==(other) ⇒ Object
- #add_tags(tags = Benelux::Tags.new) ⇒ Object (also: #add_tag)
- #distance(time) ⇒ Object
- #inspect(reftime = nil) ⇒ Object
- #remove_tags(*tags) ⇒ Object (also: #remove_tag)
- #to_s(reftime = nil) ⇒ Object
- #track ⇒ Object
Methods included from TagHelpers
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/benelux/mark.rb', line 4 def name @name end |
Class Method Details
Instance Method Details
#==(other) ⇒ Object
33 34 35 36 37 38 |
# File 'lib/benelux/mark.rb', line 33 def ==(other) return false unless other.respond_to? :call_id self.name == other.name && self. == other. && self.to_f == self.to_f end |
#add_tags(tags = Benelux::Tags.new) ⇒ Object Also known as: add_tag
14 15 16 |
# File 'lib/benelux/mark.rb', line 14 def (=Benelux::Tags.new) @tags.merge! end |
#distance(time) ⇒ Object
30 31 32 |
# File 'lib/benelux/mark.rb', line 30 def distance(time) self - time end |
#inspect(reftime = nil) ⇒ Object
22 23 24 25 |
# File 'lib/benelux/mark.rb', line 22 def inspect(reftime=nil) val = reftime.nil? ? self : (reftime - self) "#<%s:%s at=%f name=%s %s>" % [self.class, hexoid, to_f, name, ] end |
#remove_tags(*tags) ⇒ Object Also known as: remove_tag
18 19 20 |
# File 'lib/benelux/mark.rb', line 18 def (*) @tags.delete_if { |n,v| .member?(n) } end |
#to_s(reftime = nil) ⇒ Object
26 27 28 29 |
# File 'lib/benelux/mark.rb', line 26 def to_s(reftime=nil) val = reftime.nil? ? self : (reftime - self) val.to_f.to_s end |
#track ⇒ Object
11 12 13 |
# File 'lib/benelux/mark.rb', line 11 def track @tags[:track] end |