Class: Serel::Info

Inherits:
Base
  • Object
show all
Defined in:
lib/serel/info.rb

Overview

The Info class represents information about a Stack Exchange site.

Getting info

The /info route accepts no parameters and requires no IDs, so the default finder methods cannot be used. We therefore have a custom finder defined, Info.get_info.

Class Method Summary collapse

Methods inherited from Base

#[], #[]=, #all, associations, attribute, config, #find, finder_methods, #get, #initialize, #inspect, #meth, method_missing, #network, network_wide, new_relation, request, respond_to?, #type, with_ids

Constructor Details

This class inherits a constructor from Serel::Base

Class Method Details

.get_infoSerel::Info

Gets information about the current site.

It is best practice to aggresively cache the returned values with a TTL of at least 3600 seconds.

Returns:



30
31
32
# File 'lib/serel/info.rb', line 30

def self.get_info
  new_relation(:info, :singular).url("info").get
end