Sha256: 2fbae9c6bde3144a8440808cd68ff3dfafe9d2daacf12928dd65bcf27f3d0590

Contents?: true

Size: 947 Bytes

Versions: 4

Compression:

Stored size: 947 Bytes

Contents

# @author Filip Jakubowski
module JiraIssues
  class JiraQuery
    # Creates new Query object 
    # and sets the maximum number of issues returned by Query
    # @param max_results [Integer] maximum number of issues returned by query
    def initialize(max_results = 1000)
      @query_max_results = max_results
    end

    # Handles a JQL Request and returns JiraIssueavigator for that query
    # @param query [String] 
    # @return [JiraIssueNavigator] with those requests
    def jql_query(query)
      result = adapter.jql(query, fields:[:description, :summary, :created, :status, :issuetype, :priority, :resolutiondate, :duedate], max_results: @query_max_results)
      JiraIssuesNavigator.new(result.map { |i| JiraIssueMapper.new.call(i) })
    end

    private
    # Provides adapter that connects to JIRA
    # @return [JiraAdapter] with those requests
    def adapter
      @adapter ||= JiraIssues::JiraAdapter.new
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
jira_issues-0.0.10 lib/jira_issues/jira_query.rb
jira_issues-0.0.9 lib/jira_issues/jira_query.rb
jira_issues-0.0.8 lib/jira_issues/jira_query.rb
jira_issues-0.0.7 lib/jira_issues/jira_query.rb