Class: MachineShop::Rule

Inherits:
APIResource show all
Includes:
APIOperations::Create, APIOperations::Delete, APIOperations::List
Defined in:
lib/machineshop/rule.rb

Instance Attribute Summary

Attributes inherited from MachineShopObject

#auth_token

Class Method Summary collapse

Instance Method Summary collapse

Methods included from APIOperations::Delete

#delete

Methods included from APIOperations::Create

included

Methods included from APIOperations::List

included

Methods inherited from APIResource

class_name, #refresh, retrieve, url, #url

Methods inherited from MachineShopObject

#[], #[]=, #as_json, construct_from, #each, #initialize, #inspect, #keys, #refresh_from, #to_hash, #to_json, #to_s, #values

Constructor Details

This class inherits a constructor from MachineShop::MachineShopObject

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class MachineShop::MachineShopObject

Class Method Details

.get_by_device_instance(auth_token, id) ⇒ Object



26
27
28
29
# File 'lib/machineshop/rule.rb', line 26

def self.get_by_device_instance(auth_token,id)
  url = platform_url + "/rule/device_instance/#{id}"
  MachineShop.gem_get(url, auth_token)
end

.get_comparison_rule_conditions(auth_token) ⇒ Object



16
17
18
19
# File 'lib/machineshop/rule.rb', line 16

def self.get_comparison_rule_conditions(auth_token)
  url = platform_url + "/rule/comparison_rule_conditions"
  MachineShop.gem_get(url, auth_token)
end

.get_deleted(auth_token) ⇒ Object



21
22
23
24
# File 'lib/machineshop/rule.rb', line 21

def self.get_deleted(auth_token)
  url = platform_url + "/rules/deleted"
  MachineShop.gem_get(url, auth_token)
end

.get_join_rule_conditions(auth_token) ⇒ Object



11
12
13
14
# File 'lib/machineshop/rule.rb', line 11

def self.get_join_rule_conditions(auth_token)
  url = platform_url + "/rule/join_rule_conditions"
  MachineShop.gem_get(url, auth_token)
end

.platform_urlObject



7
8
9
# File 'lib/machineshop/rule.rb', line 7

def self.platform_url
  '/platform'
end

Instance Method Details

#delete_rule(auth_token, id) ⇒ Object



36
37
38
39
# File 'lib/machineshop/rule.rb', line 36

def delete_rule(auth_token, id)
  url = platform_url + "/rule/#{id}"
  MachineShop.gem_delete(url, auth_token)
end

#post_rule(auth_token, rule_hash) ⇒ Object



31
32
33
34
# File 'lib/machineshop/rule.rb', line 31

def post_rule(auth_token, rule_hash)
  url = platform_url + "/rule"
  MachineShop.gem_post(url, auth_token, rule_hash)
end