Class: Serel::Info
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
-
.get_info ⇒ Serel::Info
Gets information about the current site.
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_info ⇒ Serel::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.
30 31 32 |
# File 'lib/serel/info.rb', line 30 def self.get_info new_relation(:info, :singular).url("info").get end |