Class: BunBun::Client::PullZone

Inherits:
Namespace show all
Defined in:
lib/bunbun/client/pull_zone.rb

Defined Under Namespace

Classes: EdgeRules

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Namespace

#inspect

Constructor Details

#initialize(client) ⇒ PullZone

Returns a new instance of PullZone.



6
7
8
9
10
# File 'lib/bunbun/client/pull_zone.rb', line 6

def initialize(client)
  super

  @edge_rules = EdgeRules.new(client)
end

Instance Attribute Details

#edge_rulesObject (readonly)

Returns the value of attribute edge_rules.



20
21
22
# File 'lib/bunbun/client/pull_zone.rb', line 20

def edge_rules
  @edge_rules
end

Instance Method Details

#create(body_params) ⇒ Object



12
13
14
# File 'lib/bunbun/client/pull_zone.rb', line 12

def create(body_params)
  @client.post('/pullzone', BunBun::Body.transform_keys(body_params))
end

#delete(id) ⇒ Object



16
17
18
# File 'lib/bunbun/client/pull_zone.rb', line 16

def delete(id)
  @client.delete("/pullzone/#{id}")
end

#get(id) ⇒ Object



22
23
24
# File 'lib/bunbun/client/pull_zone.rb', line 22

def get(id)
  @client.get("/pullzone/#{id}")
end

#listObject



26
27
28
# File 'lib/bunbun/client/pull_zone.rb', line 26

def list
  @client.get('/pullzone')
end

#purge(id) ⇒ Object



30
31
32
# File 'lib/bunbun/client/pull_zone.rb', line 30

def purge(id)
  @client.post("/pullzone/#{id}/purgeCache")
end

#update(id, body_params) ⇒ Object



34
35
36
# File 'lib/bunbun/client/pull_zone.rb', line 34

def update(id, body_params)
  @client.post("/pullzone/#{id}", BunBun::Body.transform_keys(body_params))
end