Class: TimexDatalinkClient::Protocol7::Eeprom::Calendar
- Inherits:
-
Object
- Object
- TimexDatalinkClient::Protocol7::Eeprom::Calendar
- Defined in:
- lib/timex_datalink_client/protocol_7/eeprom/calendar.rb,
lib/timex_datalink_client/protocol_7/eeprom/calendar/event.rb
Defined Under Namespace
Classes: Event
Constant Summary collapse
- DAY_START_TIME =
Time.new(2000)
- DAY_SECONDS =
86400
- EVENTS_BYTES_BASE =
2
- EVENTS_BYTES_EVENT =
4
- EVENTS_BYTES_PHRASE_PACKET =
5
- PACKETS_TERMINATOR =
0x01
Constants included from Helpers::FourByteFormatter
Helpers::FourByteFormatter::BYTE_NULL, Helpers::FourByteFormatter::BYTE_TERMINATOR_ENDF, Helpers::FourByteFormatter::BYTE_TERMINATOR_ENDR
Instance Attribute Summary collapse
-
#events ⇒ Object
Returns the value of attribute events.
-
#time ⇒ Object
Returns the value of attribute time.
Instance Method Summary collapse
-
#initialize(time:, events: []) ⇒ Calendar
constructor
Create a Calendar instance.
-
#packet ⇒ Array<Integer>
Compile data for calendar.
Methods included from Helpers::LsbMsbFormatter
Methods included from Helpers::FourByteFormatter
Constructor Details
#initialize(time:, events: []) ⇒ Calendar
Create a Calendar instance.
29 30 31 32 |
# File 'lib/timex_datalink_client/protocol_7/eeprom/calendar.rb', line 29 def initialize(time:, events: []) @time = time @events = events end |
Instance Attribute Details
#events ⇒ Object
Returns the value of attribute events.
22 23 24 |
# File 'lib/timex_datalink_client/protocol_7/eeprom/calendar.rb', line 22 def events @events end |
#time ⇒ Object
Returns the value of attribute time.
22 23 24 |
# File 'lib/timex_datalink_client/protocol_7/eeprom/calendar.rb', line 22 def time @time end |
Instance Method Details
#packet ⇒ Array<Integer>
Compile data for calendar.
37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/timex_datalink_client/protocol_7/eeprom/calendar.rb', line 37 def packet [ events_count, event_packets, event_phrases, time.hour, time.min, days_from_2000, time_formatted, PACKETS_TERMINATOR ].flatten end |