Class: Geet::Services::CreateLabel

Inherits:
Object
  • Object
show all
Defined in:
lib/geet/services/create_label.rb

Instance Method Summary collapse

Constructor Details

#initialize(repository, out: $stdout) ⇒ CreateLabel

Returns a new instance of CreateLabel.



6
7
8
9
# File 'lib/geet/services/create_label.rb', line 6

def initialize(repository, out: $stdout)
  @repository = repository
  @out = out
end

Instance Method Details

#execute(name, color: generate_random_color) ⇒ Object



11
12
13
14
15
16
17
# File 'lib/geet/services/create_label.rb', line 11

def execute(name, color: generate_random_color)
  label = create_label(name, color)

  @out.puts "Created with color ##{label.color}"

  label
end