Module: Goraku::Client::Rules

Included in:
Goraku::Client
Defined in:
lib/goraku/client/rules.rb

Instance Method Summary collapse

Instance Method Details

#add_rule(rule) ⇒ Object



29
30
31
# File 'lib/goraku/client/rules.rb', line 29

def add_rule(rule)
  post '/rules.json', rule
end

#delete_rule(rule_num) ⇒ Object



17
18
19
# File 'lib/goraku/client/rules.rb', line 17

def delete_rule(rule_num)
  delete "/rules/#{rule_num}.json"
end

#rule(rule_num) ⇒ Object



9
10
11
# File 'lib/goraku/client/rules.rb', line 9

def rule(rule_num)
  get "/rules/#{rule_num}.json"
end

#rule_disable(rule_num) ⇒ Object



25
26
27
# File 'lib/goraku/client/rules.rb', line 25

def rule_disable(rule_num)
  put "/rules/#{rule_num}/disable.json"
end

#rule_enable(rule_num) ⇒ Object



21
22
23
# File 'lib/goraku/client/rules.rb', line 21

def rule_enable(rule_num)
  put "/rules/#{rule_num}/enable.json"
end

#rulesObject



5
6
7
# File 'lib/goraku/client/rules.rb', line 5

def rules
  get '/rules.json'
end

#update_rule(rule_num, rule) ⇒ Object



13
14
15
# File 'lib/goraku/client/rules.rb', line 13

def update_rule(rule_num, rule)
  put "/rules/#{rule_num}.json", rule
end