Class: Semaph::Shells::Organisation::ProjectsListCommand

Inherits:
Object
  • Object
show all
Defined in:
lib/semaph/shells/organisation/projects_list_command.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(project_collection) ⇒ ProjectsListCommand

Returns a new instance of ProjectsListCommand.



7
8
9
10
# File 'lib/semaph/shells/organisation/projects_list_command.rb', line 7

def initialize(project_collection)
  @project_collection = project_collection
  @help = "list available projects"
end

Instance Attribute Details

#helpObject (readonly)

Returns the value of attribute help.



5
6
7
# File 'lib/semaph/shells/organisation/projects_list_command.rb', line 5

def help
  @help
end

#usageObject (readonly)

Returns the value of attribute usage.



5
6
7
# File 'lib/semaph/shells/organisation/projects_list_command.rb', line 5

def usage
  @usage
end

Instance Method Details

#execute(_whatever) ⇒ Object



12
13
14
15
16
17
# File 'lib/semaph/shells/organisation/projects_list_command.rb', line 12

def execute(_whatever)
  @project_collection.reload
  @project_collection.all.each do |project|
    puts project.name
  end
end