Class: Troo::Commands::ShowComments

Inherits:
Object
  • Object
show all
Defined in:
lib/troo/cli/commands/show/show_comments.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id = nil) ⇒ Object

Returns [].

Parameters:

  • []


16
17
18
# File 'lib/troo/cli/commands/show/show_comments.rb', line 16

def initialize(id = nil)
  @id = id
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



4
5
6
# File 'lib/troo/cli/commands/show/show_comments.rb', line 4

def id
  @id
end

Class Method Details

.dispatch(id = nil) ⇒ Object

Returns [].

Parameters:

  • []

Returns:



9
10
11
# File 'lib/troo/cli/commands/show/show_comments.rb', line 9

def dispatch(id = nil)
  new(id).render
end

Instance Method Details

#renderObject

Returns [].

Returns:



21
22
23
24
25
26
27
28
29
# File 'lib/troo/cli/commands/show/show_comments.rb', line 21

def render
  if resource
    presenter
  elsif no_default?
    [error, no_default].join(' ')
  else
    error
  end
end