Class: Redmine::Commands::Projects

Inherits:
Object
  • Object
show all
Extended by:
Redmine::Command
Defined in:
lib/redmine/commands/projects.rb

Overview

Command to list projects in Redmine.

Instance Method Summary collapse

Methods included from Redmine::Command

extended, usage, usage_description, usage_options

Constructor Details

#initialize(redmine:) ⇒ Projects

Returns a new instance of Projects.



9
10
11
# File 'lib/redmine/commands/projects.rb', line 9

def initialize(redmine:)
  @redmine = redmine
end

Instance Method Details

#call(_arguments) ⇒ Object



13
14
15
16
17
# File 'lib/redmine/commands/projects.rb', line 13

def call(_arguments)
  @redmine.projects.each do |project|
    puts "#{project.id} #{project.name}"
  end
end