Class: Kozo::Commands::State::Show
- Inherits:
-
Kozo::Commands::State
- Object
- Kozo::Command
- Kozo::Commands::State
- Kozo::Commands::State::Show
- Defined in:
- lib/kozo/commands/state/show.rb
Instance Attribute Summary collapse
-
#address ⇒ Object
readonly
Returns the value of attribute address.
Attributes inherited from Kozo::Commands::State
Attributes inherited from Kozo::Command
Instance Method Summary collapse
-
#initialize(configuration, *args) ⇒ Show
constructor
A new instance of Show.
- #start ⇒ Object
Constructor Details
#initialize(configuration, *args) ⇒ Show
Returns a new instance of Show.
11 12 13 14 15 16 |
# File 'lib/kozo/commands/state/show.rb', line 11 def initialize(configuration, *args) @configuration = configuration @address = args.shift raise UsageError, "address not specified" unless address end |
Instance Attribute Details
#address ⇒ Object (readonly)
Returns the value of attribute address.
9 10 11 |
# File 'lib/kozo/commands/state/show.rb', line 9 def address @address end |
Instance Method Details
#start ⇒ Object
18 19 20 21 22 23 24 25 26 |
# File 'lib/kozo/commands/state/show.rb', line 18 def start resource = state .resources .find { |r| r.address == address } raise StateError, "no such resource address: #{address}" unless resource Kozo.logger.info Operations::Show.new(resource).to_s end |