Class: SentrySummary::Sentry

Inherits:
Object
  • Object
show all
Defined in:
lib/sentry-summary/sentry.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(&block) ⇒ Sentry

Returns a new instance of Sentry.



8
9
10
# File 'lib/sentry-summary/sentry.rb', line 8

def initialize(&block)
  block.call(self)
end

Instance Attribute Details

#organization=(value) ⇒ Object (writeonly)

Sets the attribute organization

Parameters:

  • value

    the value to set the attribute organization to.



6
7
8
# File 'lib/sentry-summary/sentry.rb', line 6

def organization=(value)
  @organization = value
end

#token=(value) ⇒ Object (writeonly)

Sets the attribute token

Parameters:

  • value

    the value to set the attribute token to.



6
7
8
# File 'lib/sentry-summary/sentry.rb', line 6

def token=(value)
  @token = value
end

Instance Method Details

#events(issue, since = nil) ⇒ Object



25
26
27
28
29
# File 'lib/sentry-summary/sentry.rb', line 25

def events(issue, since = nil)
  paginate("/issues/#{issue}/events/", since) do |event|
    Event.build(event.merge(issue_id: issue))
  end
end

#issues(project, since = nil) ⇒ Object



12
13
14
15
16
# File 'lib/sentry-summary/sentry.rb', line 12

def issues(project, since = nil)
  paginate("projects/#{@organization}/#{project}/issues/", since) do |issue|
    Issue.build(issue)
  end
end

#latest_samples(project) ⇒ Object



18
19
20
21
22
23
# File 'lib/sentry-summary/sentry.rb', line 18

def latest_samples(project)
  issues(project).map do |issue|
    dto = request(:get, "issues/#{issue.id}/events/latest/").merge(issue_id: issue.id)
    Event.build(dto)
  end
end