Class: DBLRuby::Weekend
- Inherits:
-
Object
- Object
- DBLRuby::Weekend
- Defined in:
- lib/dblruby/weekend.rb
Overview
Find information about the weekend.
Instance Attribute Summary collapse
-
#data ⇒ Object
(also: #to_s)
readonly
Data in raw json form.
Instance Method Summary collapse
-
#initialize ⇒ Weekend
constructor
Initialize the weekend.
-
#weekend? ⇒ true, false
(also: #isweekend)
Return the whether it's the weekend.
Constructor Details
#initialize ⇒ Weekend
Initialize the weekend
4 5 6 7 |
# File 'lib/dblruby/weekend.rb', line 4 def initialize url = 'https://discordbots.org/api/weekend' @data = JSON.parse(RestClient.get(url)) end |
Instance Attribute Details
#data ⇒ Object (readonly) Also known as: to_s
Returns data in raw json form.
10 11 12 |
# File 'lib/dblruby/weekend.rb', line 10 def data @data end |
Instance Method Details
#weekend? ⇒ true, false Also known as: isweekend
Return the whether it's the weekend.
16 17 18 |
# File 'lib/dblruby/weekend.rb', line 16 def weekend? @data['is_weekend'] end |