Class: Rubyoverflow::ApiSites

Inherits:
Base
  • Object
show all
Defined in:
lib/rubyoverflow/apiSites.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

change_end_point, client, convert_if_array, convert_to_id_list, #find_parse_querystring, request, #request

Constructor Details

#initialize(hash, url = '') ⇒ ApiSites

Returns a new instance of ApiSites.



4
5
6
7
8
9
# File 'lib/rubyoverflow/apiSites.rb', line 4

def initialize(hash, url = '')
  mash = ApiSitesDash.new hash
  @api_sites = Array.new

  mash.api_sites.each{|siteHash| @api_sites.push(ApiSite.new siteHash)}
end

Instance Attribute Details

#api_sitesObject (readonly)

Returns the value of attribute api_sites.



3
4
5
# File 'lib/rubyoverflow/apiSites.rb', line 3

def api_sites
  @api_sites
end

Class Method Details

.retrieve_sitesObject



12
13
14
15
16
17
18
# File 'lib/rubyoverflow/apiSites.rb', line 12

def retrieve_sites()
  client = Client.stackauth_client(Base.client.api_key)

  hash,url = client.request('sites',{})

  ApiSites.new hash,url
end