Class: D3Parser

Inherits:
Object
  • Object
show all
Defined in:
lib/parser/d3_parser.rb

Overview

Constant Summary collapse

BATTLENET_WEB =
"http://us.battle.net/d3/en/status"
DIV_CONTENT =
"div.box"
DIV_CLASS =
"div.status-icon"
TOOLTIP =
"data-tooltip"

Instance Method Summary collapse

Constructor Details

#initializeD3Parser

Returns a new instance of D3Parser.



9
10
11
12
13
# File 'lib/parser/d3_parser.rb', line 9

def initialize
	doc = Nokogiri::HTML(open(BATTLENET_WEB))
	@html_statuses = doc.search(DIV_CONTENT)
	construct_statuses
end

Instance Method Details

#asia_serverObject



23
24
25
# File 'lib/parser/d3_parser.rb', line 23

def asia_server
	fuzzy_cute_cute("Server ASIA : #{@statuses[2]}", @statuses[2])
end

#eu_serverObject



19
20
21
# File 'lib/parser/d3_parser.rb', line 19

def eu_server
	fuzzy_cute_cute("Server EU   : #{@statuses[1]}", @statuses[1])
end

#us_serverObject



15
16
17
# File 'lib/parser/d3_parser.rb', line 15

def us_server
	fuzzy_cute_cute("Server US   : #{@statuses[0]}", @statuses[0])
end