Class: Pagerdupi::Incident

Inherits:
Object
  • Object
show all
Defined in:
lib/pagerdupi/incidents.rb

Instance Method Summary collapse

Constructor Details

#initialize(api_key) ⇒ Incident

Returns a new instance of Incident.



4
5
6
# File 'lib/pagerdupi/incidents.rb', line 4

def initialize(api_key)
  @pagerdupi = Pagerdupi::Client.new(api_key)
end

Instance Method Details

#create(params = {}) ⇒ Object



23
24
# File 'lib/pagerdupi/incidents.rb', line 23

def create(params = {})
end

#delete(params = {}) ⇒ Object



29
30
# File 'lib/pagerdupi/incidents.rb', line 29

def delete(params = {})
end

#list(params = {}) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
# File 'lib/pagerdupi/incidents.rb', line 8

def list(params = {})
  default_params = {
    limit: 25,
    since: (Time.now - 7 * 24 * 60 * 60).strftime('%Y-%m-%d'),
    until: Time.now.strftime('%Y-%m-%d'),
    time_zone: 'Asia/Tokyo',
  }
  query_params = default_params.merge(params)

  Hashie::Mash.new(@pagerdupi.get('/incidents', query: query_params))
end

#show(params = {}) ⇒ Object



20
21
# File 'lib/pagerdupi/incidents.rb', line 20

def show(params = {})
end

#update(params = {}) ⇒ Object



26
27
# File 'lib/pagerdupi/incidents.rb', line 26

def update(params = {})
end