Class: Geet::Services::CreateLabel
- Inherits:
-
Object
- Object
- Geet::Services::CreateLabel
- Extended by:
- T::Sig
- Defined in:
- lib/geet/services/create_label.rb
Instance Method Summary collapse
- #execute(name, color: generate_random_color) ⇒ Object
-
#initialize(repository, out: $stdout) ⇒ CreateLabel
constructor
A new instance of CreateLabel.
Constructor Details
#initialize(repository, out: $stdout) ⇒ CreateLabel
Returns a new instance of CreateLabel.
12 13 14 15 |
# File 'lib/geet/services/create_label.rb', line 12 def initialize(repository, out: $stdout) @repository = repository @out = out end |
Instance Method Details
#execute(name, color: generate_random_color) ⇒ Object
24 25 26 27 28 29 30 |
# File 'lib/geet/services/create_label.rb', line 24 def execute(name, color: generate_random_color) label = create_label(name, color) @out.puts "Created with color ##{label.color}" label end |