Class: Sidemash::Sdk::HookWsCall
- Inherits:
-
Hook
- Object
- Hook
- Sidemash::Sdk::HookWsCall
show all
- Defined in:
- lib/sidemash/sdk/hook_ws_call.rb
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Hook
#http_call?, #not_http_call?, #not_ws_call?, #ws_call?
Constructor Details
#initialize(method, url) ⇒ HookWsCall
Returns a new instance of HookWsCall.
25
26
27
28
29
|
# File 'lib/sidemash/sdk/hook_ws_call.rb', line 25
def initialize(method, url)
@_type = 'Hook.WsCall'
@method = method
@url = url
end
|
Instance Attribute Details
#method ⇒ Object
Returns the value of attribute method.
22
23
24
|
# File 'lib/sidemash/sdk/hook_ws_call.rb', line 22
def method
@method
end
|
#url ⇒ Object
Returns the value of attribute url.
23
24
25
|
# File 'lib/sidemash/sdk/hook_ws_call.rb', line 23
def url
@url
end
|
Class Method Details
._type ⇒ Object
31
32
33
|
# File 'lib/sidemash/sdk/hook_ws_call.rb', line 31
def self._type
'Hook.WsCall'
end
|
.from_hash(h) ⇒ Object
61
62
63
64
|
# File 'lib/sidemash/sdk/hook_ws_call.rb', line 61
def self.from_hash(h)
HookWsCall.new(HttpMethod.from_s(h['method']),
h['url'])
end
|
.from_json(js) ⇒ Object
35
36
37
38
|
# File 'lib/sidemash/sdk/hook_ws_call.rb', line 35
def self.from_json(js)
h = JSON.parse(js)
HookWsCall.from_hash(h)
end
|
.from_remote(h) ⇒ Object
56
57
58
59
|
# File 'lib/sidemash/sdk/hook_ws_call.rb', line 56
def self.from_remote(h)
HookWsCall.new(HttpMethod.from_s(h['method']),
h['url'])
end
|
Instance Method Details
#to_hash ⇒ Object
48
49
50
51
52
53
54
|
# File 'lib/sidemash/sdk/hook_ws_call.rb', line 48
def to_hash
result = {}
result[:_type] = @_type
result[:method] = @method.to_s
result[:url] = @url
result
end
|
#to_json(*a) ⇒ Object
66
67
68
|
# File 'lib/sidemash/sdk/hook_ws_call.rb', line 66
def to_json(*a)
to_hash.to_json(*a)
end
|
#to_remote ⇒ Object
40
41
42
43
44
45
46
|
# File 'lib/sidemash/sdk/hook_ws_call.rb', line 40
def to_remote
result = {}
result[:_type] = @_type
result[:method] = @method.to_s
result[:url] = @url
result
end
|
#to_s ⇒ Object
70
71
72
73
|
# File 'lib/sidemash/sdk/hook_ws_call.rb', line 70
def to_s
('HookWsCall(method=' + @method.to_s +
', url=' + @url + ')')
end
|