Class: Fbtxt::Model::EventSub
- Inherits:
-
Object
- Object
- Fbtxt::Model::EventSub
- Defined in:
- lib/fbtxt/document/models/event.rb
Overview
use just Sub or ??
Instance Attribute Summary collapse
-
#minute ⇒ Object
readonly
Returns the value of attribute minute.
-
#name_off ⇒ Object
readonly
use off only.
-
#name_on ⇒ Object
readonly
use on only - why? why not?.
Instance Method Summary collapse
- #as_json ⇒ Object
-
#initialize(on:, off:, minute: nil) ⇒ EventSub
constructor
A new instance of EventSub.
Constructor Details
#initialize(on:, off:, minute: nil) ⇒ EventSub
Returns a new instance of EventSub.
47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/fbtxt/document/models/event.rb', line 47 def initialize( on:, off:, minute: nil ) @name_on = on @name_off = off ## note - auto-convert to our own Minute format @minute = if minute.is_a?( RaccMatchParser::Minute ) Minute.new( m: minute.m, offset: minute.offset, secs: minute.secs ) else minute end end |
Instance Attribute Details
#minute ⇒ Object (readonly)
Returns the value of attribute minute.
45 46 47 |
# File 'lib/fbtxt/document/models/event.rb', line 45 def minute @minute end |
#name_off ⇒ Object (readonly)
use off only
44 45 46 |
# File 'lib/fbtxt/document/models/event.rb', line 44 def name_off @name_off end |
#name_on ⇒ Object (readonly)
use on only - why? why not?
43 44 45 |
# File 'lib/fbtxt/document/models/event.rb', line 43 def name_on @name_on end |
Instance Method Details
#as_json ⇒ Object
61 62 63 64 65 66 67 |
# File 'lib/fbtxt/document/models/event.rb', line 61 def as_json(*) h = { 'on' => name_on, 'off' => name_off } h['minute'] = minute.to_s if minute h end |