Class: PromisePay::Callback
- Inherits:
-
Object
- Object
- PromisePay::Callback
- Includes:
- Lib::DynamicAccessors
- Defined in:
- lib/promise_pay/callback.rb
Constant Summary collapse
- ENDPOINT =
'callbacks/'
Instance Attribute Summary collapse
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#enabled ⇒ Object
readonly
Returns the value of attribute enabled.
-
#endpoint ⇒ Object
readonly
Returns the value of attribute endpoint.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#method ⇒ Object
readonly
Returns the value of attribute method.
-
#object_type ⇒ Object
readonly
Returns the value of attribute object_type.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Class Method Summary collapse
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(options = {}) ⇒ Callback
constructor
A new instance of Callback.
Methods included from Lib::DynamicAccessors
#accessor_defined?, #assign_instance_variables, #define_accessor, #initialize_property, #set_property
Constructor Details
#initialize(options = {}) ⇒ Callback
Returns a new instance of Callback.
31 32 33 34 35 36 37 38 39 40 |
# File 'lib/promise_pay/callback.rb', line 31 def initialize( = {}) @id = .fetch(:id) { nil } @url = .fetch(:url) { "" } @description = .fetch(:description) { "" } @object_type = .fetch(:object_type) { "" } @enabled = .fetch(:enabled) { true } @method = .fetch(:method) @endpoint = ENDPOINT + @id.to_s end |
Instance Attribute Details
#description ⇒ Object (readonly)
Returns the value of attribute description.
12 13 14 |
# File 'lib/promise_pay/callback.rb', line 12 def description @description end |
#enabled ⇒ Object (readonly)
Returns the value of attribute enabled.
14 15 16 |
# File 'lib/promise_pay/callback.rb', line 14 def enabled @enabled end |
#endpoint ⇒ Object (readonly)
Returns the value of attribute endpoint.
17 18 19 |
# File 'lib/promise_pay/callback.rb', line 17 def endpoint @endpoint end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
10 11 12 |
# File 'lib/promise_pay/callback.rb', line 10 def id @id end |
#method ⇒ Object (readonly)
Returns the value of attribute method.
16 17 18 |
# File 'lib/promise_pay/callback.rb', line 16 def method @method end |
#object_type ⇒ Object (readonly)
Returns the value of attribute object_type.
13 14 15 |
# File 'lib/promise_pay/callback.rb', line 13 def object_type @object_type end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
11 12 13 |
# File 'lib/promise_pay/callback.rb', line 11 def url @url end |
Class Method Details
.create(options = {}) ⇒ Object
27 28 29 |
# File 'lib/promise_pay/callback.rb', line 27 def self.create( = {}) new(.merge(method: :post)).execute end |
.delete(options = {}) ⇒ Object
23 24 25 |
# File 'lib/promise_pay/callback.rb', line 23 def self.delete( = {}) new(.merge(method: :delete)).execute end |
.index(options = {}) ⇒ Object
19 20 21 |
# File 'lib/promise_pay/callback.rb', line 19 def self.index( = {}) new(.merge(method: :get)).execute end |
Instance Method Details
#execute ⇒ Object
42 43 44 45 |
# File 'lib/promise_pay/callback.rb', line 42 def execute assign_instance_variables(result) self end |