Class: Pvectl::Models::TimeConfig
- Defined in:
- lib/pvectl/models/time_config.rb
Overview
Represents the time and timezone settings of a Proxmox node.
Immutable value object holding the response from ‘GET /nodes/node/time`, augmented with the node name (which is not part of the API payload but is the identifying context for the lookup).
Display formatting is handled by Presenters::TimeConfig.
Instance Attribute Summary collapse
-
#localtime ⇒ Integer?
readonly
Seconds since epoch interpreted as the node’s local wall clock (Proxmox returns the local clock encoded as if it were UTC).
-
#node_name ⇒ String?
readonly
Node name (identifies which node this config belongs to).
-
#time ⇒ Integer?
readonly
Seconds since epoch (UTC).
-
#timezone ⇒ String?
readonly
IANA timezone name (e.g., “Europe/Warsaw”, “UTC”).
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ TimeConfig
constructor
Creates a new TimeConfig.
Constructor Details
#initialize(attributes = {}) ⇒ TimeConfig
Creates a new TimeConfig.
38 39 40 41 42 43 44 |
# File 'lib/pvectl/models/time_config.rb', line 38 def initialize(attributes = {}) super @node_name = @attributes[:node_name] @time = @attributes[:time] @localtime = @attributes[:localtime] @timezone = @attributes[:timezone] end |
Instance Attribute Details
#localtime ⇒ Integer? (readonly)
Returns seconds since epoch interpreted as the node’s local wall clock (Proxmox returns the local clock encoded as if it were UTC).
30 31 32 |
# File 'lib/pvectl/models/time_config.rb', line 30 def localtime @localtime end |
#node_name ⇒ String? (readonly)
Returns node name (identifies which node this config belongs to).
23 24 25 |
# File 'lib/pvectl/models/time_config.rb', line 23 def node_name @node_name end |
#time ⇒ Integer? (readonly)
Returns seconds since epoch (UTC).
26 27 28 |
# File 'lib/pvectl/models/time_config.rb', line 26 def time @time end |
#timezone ⇒ String? (readonly)
Returns IANA timezone name (e.g., “Europe/Warsaw”, “UTC”).
33 34 35 |
# File 'lib/pvectl/models/time_config.rb', line 33 def timezone @timezone end |