Class: Pina::Contact

Inherits:
Object
  • Object
show all
Extended by:
Resource
Defined in:
lib/pina/contact.rb

Class Method Summary collapse

Methods included from Resource

paginate, per_page, resource_methods

Class Method Details

.find_by(hash) ⇒ Object



17
18
19
20
21
22
23
# File 'lib/pina/contact.rb', line 17

def find_by(hash)
  response = where(hash)

  return response.items.first if response.is_a? Pina::Collections::Contact

  response
end

.new(params = nil) ⇒ Object



13
14
15
# File 'lib/pina/contact.rb', line 13

def new(params = nil)
  Pina::Models::Contact.new(params)
end