Class: Benelux::Mark
Instance Attribute Summary collapse
#tags
Class Method Summary
collapse
Instance Method Summary
collapse
#add_tags, #add_tags_quick, #init_tags!, #remove_tags, #tag_values
Instance Attribute Details
Returns the value of attribute name.
4
5
6
|
# File 'lib/benelux/mark.rb', line 4
def name
@name
end
|
Class Method Details
.now(n = nil) ⇒ Object
5
6
7
8
9
10
|
# File 'lib/benelux/mark.rb', line 5
def self.now(n=nil)
v = super()
v.tags = Selectable::Tags.new
v.name = n
v
end
|
Instance Method Details
#==(other) ⇒ Object
25
26
27
28
29
|
# File 'lib/benelux/mark.rb', line 25
def ==(other)
self.name == other.name &&
self.tags == other.tags &&
self.to_f == self.to_f
end
|
#distance(time) ⇒ Object
22
23
24
|
# File 'lib/benelux/mark.rb', line 22
def distance(time)
self - time
end
|
#inspect(reftime = nil) ⇒ Object
14
15
16
17
|
# File 'lib/benelux/mark.rb', line 14
def inspect(reftime=nil)
val = reftime.nil? ? self : (reftime - self)
"#<%s:%s at=%f name=%s %s>" % [self.class, hexoid, to_f, name, tags]
end
|
#to_s(reftime = nil) ⇒ Object
18
19
20
21
|
# File 'lib/benelux/mark.rb', line 18
def to_s(reftime=nil)
val = reftime.nil? ? self : (reftime - self)
val.to_f.to_s
end
|
11
12
13
|
# File 'lib/benelux/mark.rb', line 11
def track
@tags[:track]
end
|