Class: Benelux::Range
Instance Attribute Summary collapse
#tags
Instance Method Summary
collapse
#add_tags, #add_tags_quick, #init_tags!, #remove_tags, #tag_values
Constructor Details
#initialize(name, from, to) ⇒ Range
Returns a new instance of Range.
10
11
12
13
|
# File 'lib/benelux/range.rb', line 10
def initialize(name,from,to)
@name, @from, @to = name, from, to
@tags = Selectable::Tags.new
end
|
Instance Attribute Details
#exception ⇒ Object
Returns the value of attribute exception.
9
10
11
|
# File 'lib/benelux/range.rb', line 9
def exception
@exception
end
|
Returns the value of attribute from.
7
8
9
|
# File 'lib/benelux/range.rb', line 7
def from
@from
end
|
Returns the value of attribute name.
6
7
8
|
# File 'lib/benelux/range.rb', line 6
def name
@name
end
|
Returns the value of attribute to.
8
9
10
|
# File 'lib/benelux/range.rb', line 8
def to
@to
end
|
Instance Method Details
43
44
45
|
# File 'lib/benelux/range.rb', line 43
def <(other)
from < other
end
|
#<=>(other) ⇒ Object
40
41
42
|
# File 'lib/benelux/range.rb', line 40
def <=>(other)
from <=> other.from
end
|
46
47
48
|
# File 'lib/benelux/range.rb', line 46
def >(other)
from > other
end
|
28
29
30
|
# File 'lib/benelux/range.rb', line 28
def call_id
@from.nil? ? :unknown : @from.call_id
end
|
37
38
39
|
# File 'lib/benelux/range.rb', line 37
def duration
to - from
end
|
#failed? ⇒ Boolean
34
35
36
|
# File 'lib/benelux/range.rb', line 34
def failed?
!successful?
end
|
17
18
19
20
|
# File 'lib/benelux/range.rb', line 17
def inspect
args = [self.class, hexoid, duration, from, to, name, tags]
"#<%s:%s duration=%0.4f from=%s to=%s name=%s %s>" % args
end
|
#successful? ⇒ Boolean
31
32
33
|
# File 'lib/benelux/range.rb', line 31
def successful?
@exception.nil?
end
|
#thread_id ⇒ Object
25
26
27
|
# File 'lib/benelux/range.rb', line 25
def thread_id
@from.nil? ? :unknown : @from.thread_id
end
|
14
15
16
|
# File 'lib/benelux/range.rb', line 14
def to_s
"%s:%.4f" % [name, duration]
end
|
22
23
24
|
# File 'lib/benelux/range.rb', line 22
def track
@from.nil? ? :unknown : @from.track
end
|