Class: ConfCtl::MachineStatus::SwpinState
- Inherits:
-
Object
- Object
- ConfCtl::MachineStatus::SwpinState
- Defined in:
- lib/confctl/machine_status.rb
Instance Attribute Summary collapse
- #current_info ⇒ Hash? readonly
- #target_spec ⇒ Swpins::Specs::Base readonly
Instance Method Summary collapse
- #current_version ⇒ String?
-
#initialize(target_spec, current_info) ⇒ SwpinState
constructor
A new instance of SwpinState.
- #outdated? ⇒ Boolean
- #target_version ⇒ String?
- #uptodate? ⇒ Boolean
Constructor Details
#initialize(target_spec, current_info) ⇒ SwpinState
Returns a new instance of SwpinState.
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/confctl/machine_status.rb', line 15 def initialize(target_spec, current_info) @target_spec = target_spec @current_info = current_info @uptodate = if current_info target_spec.check_info(current_info) else false end end |
Instance Attribute Details
#current_info ⇒ Hash? (readonly)
11 12 13 |
# File 'lib/confctl/machine_status.rb', line 11 def current_info @current_info end |
#target_spec ⇒ Swpins::Specs::Base (readonly)
8 9 10 |
# File 'lib/confctl/machine_status.rb', line 8 def target_spec @target_spec end |
Instance Method Details
#current_version ⇒ String?
40 41 42 |
# File 'lib/confctl/machine_status.rb', line 40 def current_version target_spec.version_info(current_info) || 'unknown' end |
#outdated? ⇒ Boolean
30 31 32 |
# File 'lib/confctl/machine_status.rb', line 30 def outdated? !uptodate? end |
#target_version ⇒ String?
35 36 37 |
# File 'lib/confctl/machine_status.rb', line 35 def target_version target_spec.version end |
#uptodate? ⇒ Boolean
26 27 28 |
# File 'lib/confctl/machine_status.rb', line 26 def uptodate? @uptodate end |