Class: FsFamilytreeV1::Communicator

Inherits:
Object
  • Object
show all
Defined in:
lib/communicator.rb

Constant Summary collapse

Base =
'/familytree/v1/'

Instance Method Summary collapse

Constructor Details

#initialize(fs_communicator) ⇒ Communicator

params

fs_communicator: FsCommunicator instance



16
17
18
# File 'lib/communicator.rb', line 16

def initialize(fs_communicator)
  @fs_communicator = fs_communicator
end

Instance Method Details

#person(id, options = {}) ⇒ Object



20
21
22
23
24
25
# File 'lib/communicator.rb', line 20

def person(id, options = {})
  url = Base + 'person/' + id
  response = @fs_communicator.get(url)
  familytree = Familytree.parse response.body
  person = familytree.persons.person.find{|p| p.requestedId == id }
end