Class: Luxafor::Client
- Inherits:
-
Object
- Object
- Luxafor::Client
- Defined in:
- lib/client.rb
Constant Summary collapse
- BASE =
"https://api.luxafor.com/webhook/v1/actions"
Instance Attribute Summary collapse
-
#webhook_id ⇒ Object
readonly
Returns the value of attribute webhook_id.
Instance Method Summary collapse
-
#initialize(webhook_id) ⇒ Client
constructor
A new instance of Client.
- #off ⇒ Object
- #on(color = "FF00FF") ⇒ Object
Constructor Details
#initialize(webhook_id) ⇒ Client
Returns a new instance of Client.
9 10 11 |
# File 'lib/client.rb', line 9 def initialize(webhook_id) @webhook_id = webhook_id end |
Instance Attribute Details
#webhook_id ⇒ Object (readonly)
Returns the value of attribute webhook_id.
7 8 9 |
# File 'lib/client.rb', line 7 def webhook_id @webhook_id end |
Instance Method Details
#off ⇒ Object
23 24 25 |
# File 'lib/client.rb', line 23 def off on("000000") end |
#on(color = "FF00FF") ⇒ Object
13 14 15 16 17 18 19 20 21 |
# File 'lib/client.rb', line 13 def on(color = "FF00FF") HTTP.post(BASE + "/solid_color", json: { "userId": webhook_id, "actionFields": { "color": "custom", "custom_color": color } }) end |