Class: Troo::Commands::Refresh

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(klass, id = nil) ⇒ Object

Returns [].

Parameters:

  • []
  • []


18
19
20
# File 'lib/troo/cli/commands/refresh.rb', line 18

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

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



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

def id
  @id
end

Class Method Details

.dispatch(klass, id = nil) ⇒ Object

Returns [].

Parameters:

  • []
  • []

Returns:



10
11
12
# File 'lib/troo/cli/commands/refresh.rb', line 10

def dispatch(klass, id = nil)
  new(klass, id).refresh
end

Instance Method Details

#refreshObject

Returns [].

Returns:



23
24
25
26
27
# File 'lib/troo/cli/commands/refresh.rb', line 23

def refresh
  return not_found    if not_found?
  return many_success if multiple_refreshed?
  success
end