Sha256: 006bb6c1ec89d41cea07218f4270fb68fcffddec3e0145e372c94d08e3b90bfc

Contents?: true

Size: 382 Bytes

Versions: 10

Compression:

Stored size: 382 Bytes

Contents

module Cp8Cli
  class StoryQuery
    def initialize(short_link)
      @short_link = short_link
    end

    def find
      if github_issue?
        Github::Issue.find_by_short_link(short_link)
      else
        Trello::Card.find(short_link)
      end
    end

    private

      attr_reader :short_link

      def github_issue?
        short_link.include?("#")
      end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
cp8_cli-6.0.1 lib/cp8_cli/story_query.rb
cp8_cli-6.0.0 lib/cp8_cli/story_query.rb
cp8_cli-5.0.0 lib/cp8_cli/story_query.rb
cp8_cli-4.2.1 lib/cp8_cli/story_query.rb
cp8_cli-4.2.0 lib/cp8_cli/story_query.rb
cp8_cli-4.1.3 lib/cp8_cli/story_query.rb
cp8_cli-4.1.2 lib/cp8_cli/story_query.rb
cp8_cli-4.1.1 lib/cp8_cli/story_query.rb
cp8_cli-4.1.0 lib/cp8_cli/story_query.rb
cp8_cli-4.0.1 lib/cp8_cli/story_query.rb