Class: DBLRuby::Weekend

Inherits:
Object
  • Object
show all
Defined in:
lib/dblruby/weekend.rb

Overview

Find information about the weekend.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeWeekend

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

#dataObject (readonly) Also known as: to_s

Returns data in raw json form.

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.

Returns:

  • (true, false)

    the weekend status.


16
17
18
# File 'lib/dblruby/weekend.rb', line 16

def weekend?
  @data['is_weekend']
end