Sha256: 94ccba2b7527c7938f94f2b598fada68192965bc4a3a96e41ffb7011af400734

Contents?: true

Size: 640 Bytes

Versions: 6

Compression:

Stored size: 640 Bytes

Contents

module Tr3llo
  module Command
    module Card
      module Comments
        extend self

        def execute(key)
          card_id = Entities.parse_id(:card, key)
          assert_card_id!(card_id, key)

          comments = API::Card.list_comments(card_id)

          interface = Application.fetch_interface!()

          interface.print_frame do
            interface.puts(View::Card::Comments.render(comments))
          end
        end

        private

        def assert_card_id!(card_id, key)
          raise InvalidArgumentError.new("#{key.inspect} is not a valid card key") unless card_id
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
3llo-1.3.1 lib/3llo/command/card/comments.rb
3llo-1.3.1.pre.rc.0 lib/3llo/command/card/comments.rb
3llo-1.2.0 lib/3llo/command/card/comments.rb
3llo-1.1.0 lib/3llo/command/card/comments.rb
3llo-1.0.0 lib/3llo/command/card/comments.rb
3llo-1.0.0.pre.rc.0 lib/3llo/command/card/comments.rb