Class: PeopleGroup::Connectors::PTORoots

Inherits:
Object
  • Object
show all
Defined in:
lib/peoplegroup/connectors/pto_roots.rb

Instance Method Summary collapse

Constructor Details

#initializePTORoots

Returns a new instance of PTORoots.



8
9
10
11
12
# File 'lib/peoplegroup/connectors/pto_roots.rb', line 8

def initialize
  ::Splinter.configure do |config|
    config.api_key = ENV['PTO_ROOTS_API_KEY']
  end
end

Instance Method Details

#pto(params) ⇒ Object



14
15
16
# File 'lib/peoplegroup/connectors/pto_roots.rb', line 14

def pto(params)
  retry_on_error { Splinter::OOOEvents.get_all(params) }
end

#pto_type(type) ⇒ Object



18
19
20
# File 'lib/peoplegroup/connectors/pto_roots.rb', line 18

def pto_type(type)
  pto_types.find { |pto_type| pto_type['name'] == type }
end