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.
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/confctl/machine_status.rb', line 14 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)
10 11 12 |
# File 'lib/confctl/machine_status.rb', line 10 def current_info @current_info end |
#target_spec ⇒ Swpins::Specs::Base (readonly)
7 8 9 |
# File 'lib/confctl/machine_status.rb', line 7 def target_spec @target_spec end |
Instance Method Details
#current_version ⇒ String?
39 40 41 |
# File 'lib/confctl/machine_status.rb', line 39 def current_version target_spec.version_info(current_info) || 'unknown' end |
#outdated? ⇒ Boolean
29 30 31 |
# File 'lib/confctl/machine_status.rb', line 29 def outdated? !uptodate? end |
#target_version ⇒ String?
34 35 36 |
# File 'lib/confctl/machine_status.rb', line 34 def target_version target_spec.version end |
#uptodate? ⇒ Boolean
25 26 27 |
# File 'lib/confctl/machine_status.rb', line 25 def uptodate? @uptodate end |