Class: Hungry::Site
Instance Attribute Summary collapse
-
#applications ⇒ Object
Preview:.
-
#counters ⇒ Object
Preview:.
-
#country ⇒ Object
Preview:.
-
#default ⇒ Object
Preview:.
-
#email ⇒ Object
Preview:.
-
#emails ⇒ Object
Preview:.
-
#id ⇒ Object
Preview:.
-
#identifier ⇒ Object
Preview:.
-
#locale ⇒ Object
Preview:.
-
#name ⇒ Object
Preview:.
-
#newsletter_list ⇒ Object
Preview:.
-
#resources ⇒ Object
Preview:.
-
#subtitle ⇒ Object
Preview:.
-
#support_email ⇒ Object
Preview:.
-
#timezone ⇒ Object
Preview:.
-
#title ⇒ Object
Preview:.
-
#url ⇒ Object
Preview:.
Attributes inherited from Resource
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from Resource
all, belongs_to, #canonical_data_source, collection, each, find, first, get, has_many, #initialize, lazy_load, #reload
Constructor Details
This class inherits a constructor from Hungry::Resource
Instance Attribute Details
#applications ⇒ Object
Preview:
24 25 26 |
# File 'lib/hungry/site.rb', line 24 def applications @applications end |
#counters ⇒ Object
Preview:
24 25 26 |
# File 'lib/hungry/site.rb', line 24 def counters @counters end |
#country ⇒ Object
Preview:
24 25 26 |
# File 'lib/hungry/site.rb', line 24 def country @country end |
#default ⇒ Object
Preview:
24 25 26 |
# File 'lib/hungry/site.rb', line 24 def default @default end |
#email ⇒ Object
Preview:
24 25 26 |
# File 'lib/hungry/site.rb', line 24 def email @email end |
#emails ⇒ Object
Preview:
24 25 26 |
# File 'lib/hungry/site.rb', line 24 def emails @emails end |
#id ⇒ Object
Preview:
24 25 26 |
# File 'lib/hungry/site.rb', line 24 def id @id end |
#identifier ⇒ Object
Preview:
24 25 26 |
# File 'lib/hungry/site.rb', line 24 def identifier @identifier end |
#locale ⇒ Object
Preview:
24 25 26 |
# File 'lib/hungry/site.rb', line 24 def locale @locale end |
#name ⇒ Object
Preview:
24 25 26 |
# File 'lib/hungry/site.rb', line 24 def name @name end |
#newsletter_list ⇒ Object
Preview:
24 25 26 |
# File 'lib/hungry/site.rb', line 24 def end |
#resources ⇒ Object
Preview:
24 25 26 |
# File 'lib/hungry/site.rb', line 24 def resources @resources end |
#subtitle ⇒ Object
Preview:
24 25 26 |
# File 'lib/hungry/site.rb', line 24 def subtitle @subtitle end |
#support_email ⇒ Object
Preview:
24 25 26 |
# File 'lib/hungry/site.rb', line 24 def support_email @support_email end |
#timezone ⇒ Object
Preview:
24 25 26 |
# File 'lib/hungry/site.rb', line 24 def timezone @timezone end |
#title ⇒ Object
Preview:
24 25 26 |
# File 'lib/hungry/site.rb', line 24 def title @title end |
#url ⇒ Object
Preview:
24 25 26 |
# File 'lib/hungry/site.rb', line 24 def url @url end |
Class Method Details
.default_site ⇒ Object
16 17 18 |
# File 'lib/hungry/site.rb', line 16 def self.default_site collection.all(default: true).first end |
.for_country(country) ⇒ Object
12 13 14 |
# File 'lib/hungry/site.rb', line 12 def self.for_country(country) collection.all(country: country.id).first end |
.with_hostname(hostname) ⇒ Object
FINDERS:
8 9 10 |
# File 'lib/hungry/site.rb', line 8 def self.with_hostname(hostname) collection.all(hostname: hostname).first end |
Instance Method Details
#hostname ⇒ Object
31 32 33 34 |
# File 'lib/hungry/site.rb', line 31 def hostname uri = URI.parse(url) rescue nil uri && uri.hostname end |