Class: Desuraify::Company

Inherits:
Base
  • Object
show all
Defined in:
lib/desuraify/company.rb

Constant Summary collapse

ATTRIBUTES =
[
  :address, :company, :engines_count, :games_count, :html, :images, :images_count,
  :members, :members_count, :news_count, :office, :official_page, :phone, :rank, 
  :videos, :videos_count, :visits, :watchers
]

Instance Attribute Summary

Attributes inherited from Base

#callback, #error, #hydra, #id

Instance Method Summary collapse

Methods inherited from Base

#enqueue_update, #parse_headers, #parse_similar, #rss_update, #to_s, #update

Constructor Details

#initialize(id, options = {}) ⇒ Company

Returns a new instance of Company.



12
13
14
# File 'lib/desuraify/company.rb', line 12

def initialize(id, options={})
  super(id, options)
end

Instance Method Details

#attributesObject



39
40
41
# File 'lib/desuraify/company.rb', line 39

def attributes
  ATTRIBUTES
end

#image_rssObject



31
32
33
# File 'lib/desuraify/company.rb', line 31

def image_rss
  "http://rss.desura.com/company/#{@id}/images/feed/rss.xml"
end

#parse(html) ⇒ Object



16
17
18
19
20
21
22
23
24
25
# File 'lib/desuraify/company.rb', line 16

def parse(html)

  doc = Nokogiri::HTML(html)

  result = parse_headers(doc.css('h5'))
  result.merge!(parse_similar(doc))
  result[:html] = html

  result
end

#urlObject



27
28
29
# File 'lib/desuraify/company.rb', line 27

def url
  "http://www.desura.com/company/#{@id}"
end

#video_rssObject



35
36
37
# File 'lib/desuraify/company.rb', line 35

def video_rss
  "http://rss.desura.com/company/#{@id}/videos/feed/rss.xml"
end