nabil_can 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/nabil_can/version.rb +1 -1
- data/lib/nabil_can.rb +7 -7
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 99a0496656ca020aace1cbf74a27843030cfab3f
|
4
|
+
data.tar.gz: c0cc8cb320d0fef45a880b5d1d0f8a2de0b4dc93
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f19f1f989b5d677fdd763bc5f8d0bf4930f859f3371b7b0a9c0482bf10f07a9c9c83eae30871a7ecaeee344bc9b9b2534f973746ebc6b18c7e438c322268d7c0
|
7
|
+
data.tar.gz: af3b3dc4af2b1e591a6d0c6c5080963a249c3336dafa516e47752204ba12af3c492de68edc5cf0ade45724ee39c1e68e42963aeb288214e7acbb6b301a4d0e7b
|
data/lib/nabil_can/version.rb
CHANGED
data/lib/nabil_can.rb
CHANGED
@@ -2,10 +2,10 @@ require "nabil_can/version"
|
|
2
2
|
|
3
3
|
module NabilCan
|
4
4
|
# Your code goes here...
|
5
|
-
class
|
6
|
-
def self.sending_http_request(user_id,action_name,model,path)
|
7
|
-
@host =
|
8
|
-
@port =
|
5
|
+
class Ability
|
6
|
+
def self.sending_http_request(user_id,action_name,model,path,port_no,host_name)
|
7
|
+
@host = host_name
|
8
|
+
@port = port_no
|
9
9
|
@path = "#{path}?user_id=#{user_id}&action_name=#{action_name}&model=#{model}"
|
10
10
|
|
11
11
|
request = Net::HTTP::Get.new(@path, initheader = {'Content-Type' =>'application/json'})
|
@@ -15,16 +15,16 @@ module NabilCan
|
|
15
15
|
return response.body
|
16
16
|
end
|
17
17
|
|
18
|
-
def self.can(user_id,action_name,model)
|
18
|
+
def self.can(user_id,action_name,model,port_no,host_name)
|
19
19
|
path='/ability/can'
|
20
20
|
|
21
|
-
return sending_http_request(user_id,action_name,model,path)
|
21
|
+
return sending_http_request(user_id,action_name,model,path,port_no,host_name)
|
22
22
|
|
23
23
|
end
|
24
24
|
|
25
25
|
def self.cannot(user_id,action_name,model)
|
26
26
|
path='/ability/cannot'
|
27
|
-
return sending_http_request(user_id,action_name,model,path)
|
27
|
+
return sending_http_request(user_id,action_name,model,path,port_no,host_name)
|
28
28
|
end
|
29
29
|
end
|
30
30
|
end
|