Class: Troo::Commands::Show
- Inherits:
-
Object
- Object
- Troo::Commands::Show
- Defined in:
- lib/troo/cli/commands/show.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
Class Method Summary collapse
Instance Method Summary collapse
Constructor Details
#initialize(klass, id = nil) ⇒ Troo::Commands::Show
18 19 20 |
# File 'lib/troo/cli/commands/show.rb', line 18 def initialize(klass, id = nil) @klass, @id = klass, id end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
4 5 6 |
# File 'lib/troo/cli/commands/show.rb', line 4 def id @id end |
Class Method Details
.dispatch(klass, id = nil) ⇒ String
10 11 12 |
# File 'lib/troo/cli/commands/show.rb', line 10 def dispatch(klass, id = nil) new(klass, id).render end |
Instance Method Details
#render ⇒ String
23 24 25 26 27 28 29 30 31 |
# File 'lib/troo/cli/commands/show.rb', line 23 def render if resource presenter elsif no_default? [error, no_default].join(' ') else error end end |