Class: TimeScales::Parts::AbstractPart
- Inherits:
-
Object
- Object
- TimeScales::Parts::AbstractPart
show all
- Defined in:
- lib/time_scales/parts.rb
Instance Method Summary
collapse
Instance Method Details
#&(time) ⇒ Object
68
69
70
|
# File 'lib/time_scales/parts.rb', line 68
def &(time)
raise NotImplementedError, "Subclass responsibility"
end
|
#===(other) ⇒ Object
24
25
26
|
# File 'lib/time_scales/parts.rb', line 24
def ===(other)
self == other || symbol == other
end
|
#component_mixin ⇒ Object
52
53
54
|
# File 'lib/time_scales/parts.rb', line 52
def component_mixin
raise NotImplementedError, "Subclass responsibility"
end
|
#default_for_unit? ⇒ Boolean
44
45
46
|
# File 'lib/time_scales/parts.rb', line 44
def default_for_unit?
raise NotImplementedError, "Subclass responsibility"
end
|
#name ⇒ Object
60
61
62
|
# File 'lib/time_scales/parts.rb', line 60
def name
@name ||= /::([^:]+)Class$/.match( self.class.name )[1]
end
|
#scale ⇒ Object
40
41
42
|
# File 'lib/time_scales/parts.rb', line 40
def scale
subdivision.scale
end
|
#scheme_scoped_precision_mixin ⇒ Object
56
57
58
|
# File 'lib/time_scales/parts.rb', line 56
def scheme_scoped_precision_mixin
raise NotImplementedError, "Subclass responsibility"
end
|
#scope ⇒ Object
36
37
38
|
# File 'lib/time_scales/parts.rb', line 36
def scope
raise NotImplementedError, "Subclass responsibility"
end
|
#subdivision ⇒ Object
32
33
34
|
# File 'lib/time_scales/parts.rb', line 32
def subdivision
raise NotImplementedError, "Subclass responsibility"
end
|
#subdivision_name ⇒ Object
64
65
66
|
# File 'lib/time_scales/parts.rb', line 64
def subdivision_name
subdivision.name
end
|
#symbol ⇒ Object
28
29
30
|
# File 'lib/time_scales/parts.rb', line 28
def symbol
raise NotImplementedError, "Subclass responsibility"
end
|
#to_s ⇒ Object
48
49
50
|
# File 'lib/time_scales/parts.rb', line 48
def to_s
@to_s ||= self.class.name.sub(/Class$/, '').freeze
end
|
#to_time_scales_part ⇒ Object
20
21
22
|
# File 'lib/time_scales/parts.rb', line 20
def to_time_scales_part
self
end
|