Class: Minute
Overview
note - check if m(inute) might be unknown e.g. '??' or such
offset (aka stoppage/injury/added time)
Instance Attribute Summary collapse
-
#m ⇒ Object
Returns the value of attribute m.
-
#offset ⇒ Object
Returns the value of attribute offset.
-
#period ⇒ Object
Returns the value of attribute period.
Instance Method Summary collapse
-
#<=>(other) ⇒ Object
add compare (for sort).
- #as_json ⇒ Object
-
#to_s ⇒ Object
note - format minute WITHOUT minute marker/quote (').
Instance Attribute Details
#m ⇒ Object
Returns the value of attribute m
8 9 10 |
# File 'lib/fifadat/convert/helper-minute.rb', line 8 def m @m end |
#offset ⇒ Object
Returns the value of attribute offset
8 9 10 |
# File 'lib/fifadat/convert/helper-minute.rb', line 8 def offset @offset end |
#period ⇒ Object
Returns the value of attribute period
8 9 10 |
# File 'lib/fifadat/convert/helper-minute.rb', line 8 def period @period end |
Instance Method Details
#<=>(other) ⇒ Object
add compare (for sort)
20 21 22 23 24 |
# File 'lib/fifadat/convert/helper-minute.rb', line 20 def <=>( other ) res = self.m <=> other.m res = (self.offset||0) <=> (other.offset||0) if res == 0 res end |
#as_json ⇒ Object
9 |
# File 'lib/fifadat/convert/helper-minute.rb', line 9 def as_json(*) to_s; end |
#to_s ⇒ Object
note - format minute WITHOUT minute marker/quote (')
12 13 14 15 16 17 |
# File 'lib/fifadat/convert/helper-minute.rb', line 12 def to_s buf = String.new buf << "#{m}" buf << "+#{offset}" if offset buf end |