Class: PeopleGroup::Connectors::PTORoots
- Inherits:
-
Object
- Object
- PeopleGroup::Connectors::PTORoots
- Defined in:
- lib/peoplegroup/connectors/pto_roots.rb
Instance Method Summary collapse
-
#initialize ⇒ PTORoots
constructor
A new instance of PTORoots.
- #pto(params) ⇒ Object
- #pto_type(type) ⇒ Object
Constructor Details
#initialize ⇒ PTORoots
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 |