Class: Bloodbath::Event
- Inherits:
-
Object
- Object
- Bloodbath::Event
- Defined in:
- lib/bloodbath/event.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Class Method Summary collapse
- .method_missing(method_name, args = {}, &block) ⇒ Object
- .respond_to_missing?(method_name, include_private = false) ⇒ Boolean
Instance Method Summary collapse
- #cancel(id) ⇒ Object
- #find(id) ⇒ Object
-
#initialize(wait_for_response: true) ⇒ Event
constructor
A new instance of Event.
- #list ⇒ Object
- #schedule(args) ⇒ Object
Constructor Details
#initialize(wait_for_response: true) ⇒ Event
Returns a new instance of Event.
108 109 110 111 112 |
# File 'lib/bloodbath/event.rb', line 108 def initialize(wait_for_response: true) @options = { wait_for_response: wait_for_response, } end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
106 107 108 |
# File 'lib/bloodbath/event.rb', line 106 def @options end |
Class Method Details
.method_missing(method_name, args = {}, &block) ⇒ Object
95 96 97 98 99 |
# File 'lib/bloodbath/event.rb', line 95 def method_missing(method_name, args = {}, &block) return new.send(method_name, &block) if args == {} new.send(method_name, args, &block) end |
.respond_to_missing?(method_name, include_private = false) ⇒ Boolean
101 102 103 |
# File 'lib/bloodbath/event.rb', line 101 def respond_to_missing?(method_name, include_private = false) super end |
Instance Method Details
#cancel(id) ⇒ Object
126 127 128 |
# File 'lib/bloodbath/event.rb', line 126 def cancel(id) adapter.new(method: :delete, endpoint: "/events/#{id}", options: ).perform end |
#find(id) ⇒ Object
122 123 124 |
# File 'lib/bloodbath/event.rb', line 122 def find(id) adapter.new(method: :get, endpoint: "/events/#{id}", options: ).perform end |
#list ⇒ Object
118 119 120 |
# File 'lib/bloodbath/event.rb', line 118 def list adapter.new(method: :get, endpoint: "/events", options: ).perform end |
#schedule(args) ⇒ Object
114 115 116 |
# File 'lib/bloodbath/event.rb', line 114 def schedule(args) adapter.new(method: :post, endpoint: "/events", body: args, options: ).perform end |