Module: Addressabler::InstanceMethods
- Defined in:
- lib/addressabler.rb
Instance Method Summary collapse
- #domain ⇒ Object
- #domain=(new_domain) ⇒ Object
- #query_hash ⇒ Object
- #query_hash=(new_query_hash) ⇒ Object
- #subdomain ⇒ Object
- #subdomain=(new_subdomain) ⇒ Object
- #tld ⇒ Object
- #tld=(new_tld) ⇒ Object
Instance Method Details
#domain ⇒ Object
29 30 31 32 |
# File 'lib/addressabler.rb', line 29 def domain return nil unless host parse_domain_parts[:domain] end |
#domain=(new_domain) ⇒ Object
34 35 36 |
# File 'lib/addressabler.rb', line 34 def domain=(new_domain) self.host = "#{subdomain}.#{new_domain}.#{tld}" end |
#query_hash ⇒ Object
38 39 40 |
# File 'lib/addressabler.rb', line 38 def query_hash @query_hash ||= query_hash_for(query_values || {}) end |
#query_hash=(new_query_hash) ⇒ Object
42 43 44 |
# File 'lib/addressabler.rb', line 42 def query_hash=(new_query_hash) @query_hash = query_hash_for(new_query_hash || {}) end |
#subdomain ⇒ Object
46 47 48 49 |
# File 'lib/addressabler.rb', line 46 def subdomain return nil unless host parse_domain_parts[:subdomain] end |
#subdomain=(new_subdomain) ⇒ Object
51 52 53 |
# File 'lib/addressabler.rb', line 51 def subdomain=(new_subdomain) self.host = "#{new_subdomain}.#{domain}.#{tld}" end |
#tld ⇒ Object
55 56 57 58 |
# File 'lib/addressabler.rb', line 55 def tld return nil unless host self.class.parse_tld(host) end |
#tld=(new_tld) ⇒ Object
60 61 62 |
# File 'lib/addressabler.rb', line 60 def tld=(new_tld) self.host = "#{subdomain}.#{domain}.#{new_tld}" end |