Sha256: e289e1a9f28e8981a9b5d51d14218c27b0dad9228a74ca851639aff1df4a9138

Contents?: true

Size: 636 Bytes

Versions: 3

Compression:

Stored size: 636 Bytes

Contents

module Tr3llo
  module Command
    module Card
      class CommentCommand
        def initialize(card_id)
          @card_id = card_id
        end

        def execute
          interface.print_frame do
            text = interface.input.ask("Comment:")

            interface.puts(
              create_comment!(text) &&
              "Comment created"
            )
          end
        end

        private

        attr_reader :card_id

        def create_comment!(text)
          API::Card.comment(@card_id, text)
        end

        def interface
          $container.resolve(:interface)
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
3llo-0.2.0 lib/3llo/commands/card/comment.rb
3llo-0.1.12 lib/3llo/commands/card/comment.rb
3llo-0.1.11 lib/3llo/commands/card/comment.rb