Class: Namely::Connection
- Inherits:
-
Object
- Object
- Namely::Connection
- Defined in:
- lib/namely/connection.rb
Instance Method Summary collapse
-
#countries ⇒ Collection
Return a Collection of countries.
-
#currency_types ⇒ Collection
Return a Collection of currency types.
-
#events ⇒ Collection
Return a Collection of countries.
-
#fields ⇒ Collection
Return a Collection of profile fields.
-
#initialize(options) ⇒ Connection
constructor
Instantiate a new connection to the server.
-
#job_tiers ⇒ Collection
Return a Collection of job tiers.
-
#job_titles ⇒ Collection
Return a Collection of job titles.
-
#profiles ⇒ Collection
Return a Collection of profiles.
-
#reports ⇒ Collection
Return a Collection of reports.
Constructor Details
#initialize(options) ⇒ Connection
Instantiate a new connection to the server.
18 19 20 21 22 23 |
# File 'lib/namely/connection.rb', line 18 def initialize() @access_token = .fetch(:access_token) @subdomain = .fetch(:subdomain) rescue KeyError raise ArgumentError, "Please supply an access_token and subdomain." end |
Instance Method Details
#countries ⇒ Collection
Return a Collection of countries.
28 29 30 |
# File 'lib/namely/connection.rb', line 28 def countries collection("countries") end |
#currency_types ⇒ Collection
Return a Collection of currency types.
35 36 37 |
# File 'lib/namely/connection.rb', line 35 def currency_types collection("currency_types") end |
#events ⇒ Collection
Return a Collection of countries.
42 43 44 |
# File 'lib/namely/connection.rb', line 42 def events collection("events") end |
#fields ⇒ Collection
Return a Collection of profile fields.
49 50 51 |
# File 'lib/namely/connection.rb', line 49 def fields collection("profiles/fields") end |
#job_tiers ⇒ Collection
Return a Collection of job tiers.
56 57 58 |
# File 'lib/namely/connection.rb', line 56 def job_tiers collection("job_tiers") end |
#job_titles ⇒ Collection
Return a Collection of job titles.
63 64 65 |
# File 'lib/namely/connection.rb', line 63 def job_titles collection("job_titles") end |
#profiles ⇒ Collection
Return a Collection of profiles.
70 71 72 |
# File 'lib/namely/connection.rb', line 70 def profiles collection("profiles", paged: true) end |
#reports ⇒ Collection
Return a Collection of reports.
77 78 79 |
# File 'lib/namely/connection.rb', line 77 def reports collection("reports") end |