Class: Omise::Schedule
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from OmiseObject
location, resource
Methods included from Attributes
#[], #as_json, #assign_attributes, #attributes, #initialize, #key?, #location, #method_missing, #predicate?, #respond_to_missing?
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
in the class Omise::Attributes
Class Method Details
.create(attributes = {}) ⇒ Object
17
18
19
|
# File 'lib/omise/schedule.rb', line 17
def self.create(attributes = {})
new resource(location, attributes).post(attributes)
end
|
.list(attributes = {}) ⇒ Object
9
10
11
|
# File 'lib/omise/schedule.rb', line 9
def self.list(attributes = {})
List.new resource(location, attributes).get(attributes)
end
|
.retrieve(id, attributes = {}) ⇒ Object
13
14
15
|
# File 'lib/omise/schedule.rb', line 13
def self.retrieve(id, attributes = {})
new resource(location(id), attributes).get(attributes)
end
|
Instance Method Details
#destroy(attributes = {}) ⇒ Object
25
26
27
|
# File 'lib/omise/schedule.rb', line 25
def destroy(attributes = {})
assign_attributes resource(attributes).delete
end
|
#destroyed? ⇒ Boolean
29
30
31
|
# File 'lib/omise/schedule.rb', line 29
def destroyed?
status == "deleted"
end
|
#occurrences ⇒ Object
21
22
23
|
# File 'lib/omise/schedule.rb', line 21
def occurrences
list_attribute OccurrenceList, "occurrences"
end
|