Class: ContactData::Contact
- Inherits:
-
Object
- Object
- ContactData::Contact
- Defined in:
- lib/contact-data/contact.rb
Constant Summary collapse
- BASE =
:contacts
Class Method Summary collapse
- .from(source, slug, options = {}) ⇒ Object
- .from_domain(domain, options = {}) ⇒ Object
- .search(name, options = {}) ⇒ Object
Class Method Details
.from(source, slug, options = {}) ⇒ Object
14 15 16 17 18 |
# File 'lib/contact-data/contact.rb', line 14 def from(source, slug, = {}) [:base] ||= BASE [:params] ||= { source: source, slug: slug } Fetcher.get(:from, ) end |
.from_domain(domain, options = {}) ⇒ Object
20 21 22 23 24 25 26 27 28 29 |
# File 'lib/contact-data/contact.rb', line 20 def from_domain(domain, = {}) explicit_contact_type = .delete(:contact_type) [:base] ||= BASE [:api_base] ||= 'api/v3' [:params] ||= { domain: domain } [:params][:contact_type] ||= explicit_contact_type if explicit_contact_type Fetcher.get(:from_domain, ) end |