class HornOfPlenty::Adapters::Github::Requests::ListCards

Attributes

format[RW]
pagination[RW]
query[RW]
repository[RW]

Public Class Methods

new(format: 'raw', pagination: {}, query: {}, repository:) click to toggle source
# File lib/horn_of_plenty/adapters/github/requests/list_cards.rb, line 14
def initialize(format:     'raw',
               pagination: {},
               query:      {},
               repository:)

  self.format     = format
  self.pagination = pagination
  self.query      = query
  self.repository = repository
end

Public Instance Methods

method() click to toggle source
# File lib/horn_of_plenty/adapters/github/requests/list_cards.rb, line 25
def method
  'get'
end
path() click to toggle source
# File lib/horn_of_plenty/adapters/github/requests/list_cards.rb, line 29
def path
  if query[:id]
    "repos/#{repository}/projects/columns/cards/#{query[:id]}"
  elsif query[:lane_id]
    "repos/#{repository}/projects/columns/#{query[:lane_id]}/cards"
  end
end
to_h() click to toggle source
# File lib/horn_of_plenty/adapters/github/requests/list_cards.rb, line 37
def to_h
  @to_h ||= query_class.new(query).to_h.
            merge(pagination_hash)
end
Also aliased as: to_params
to_params()
Alias for: to_h

Private Instance Methods

pagination_hash() click to toggle source
# File lib/horn_of_plenty/adapters/github/requests/list_cards.rb, line 45
def pagination_hash
  pagination.to_h
end