Class: Mochizuki::Configurable::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/mochizuki/configurable.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/mochizuki/configurable.rb', line 29

def initialize
  @bot_token = nil
  @channel = nil

  @api_host = '202.120.163.129' # https://nyglzx.tongji.edu.cn
  @api_port = '88'

  @query_interval = '300s'
  @alarm_threshold = '60' # kWh

  # shitty names from legacy code
  @campus = nil   # -> drlouming
  @building = nil # -> drceng
  @floor = nil    # -> dr_ceng
  @dorm = nil     # -> drfangjian
end

Instance Attribute Details

#alarm_thresholdObject

Returns the value of attribute alarm_threshold.



24
25
26
# File 'lib/mochizuki/configurable.rb', line 24

def alarm_threshold
  @alarm_threshold
end

#api_hostObject

Returns the value of attribute api_host.



24
25
26
# File 'lib/mochizuki/configurable.rb', line 24

def api_host
  @api_host
end

#api_portObject

Returns the value of attribute api_port.



24
25
26
# File 'lib/mochizuki/configurable.rb', line 24

def api_port
  @api_port
end

#bot_tokenObject

Returns the value of attribute bot_token.



24
25
26
# File 'lib/mochizuki/configurable.rb', line 24

def bot_token
  @bot_token
end

#buildingObject

Returns the value of attribute building.



24
25
26
# File 'lib/mochizuki/configurable.rb', line 24

def building
  @building
end

#campusObject

Returns the value of attribute campus.



24
25
26
# File 'lib/mochizuki/configurable.rb', line 24

def campus
  @campus
end

#channelObject

Returns the value of attribute channel.



24
25
26
# File 'lib/mochizuki/configurable.rb', line 24

def channel
  @channel
end

#dormObject

Returns the value of attribute dorm.



24
25
26
# File 'lib/mochizuki/configurable.rb', line 24

def dorm
  @dorm
end

#floorObject

Returns the value of attribute floor.



24
25
26
# File 'lib/mochizuki/configurable.rb', line 24

def floor
  @floor
end

#query_intervalObject

Returns the value of attribute query_interval.



24
25
26
# File 'lib/mochizuki/configurable.rb', line 24

def query_interval
  @query_interval
end