Class: Cyby::UserApi
Constant Summary collapse
- AUTH =
'X-Cybozu-Authorization'
Instance Method Summary collapse
- #get(path) ⇒ Object
- #group ⇒ Object
-
#initialize ⇒ UserApi
constructor
A new instance of UserApi.
- #organization ⇒ Object
- #title ⇒ Object
- #user ⇒ Object
- #user_groups ⇒ Object
- #user_organizations ⇒ Object
- #user_services ⇒ Object
Constructor Details
#initialize ⇒ UserApi
Returns a new instance of UserApi.
7 8 9 10 11 |
# File 'lib/cyby/user_api.rb', line 7 def initialize config = YAML.load_file("#{ENV['HOME']}/.cyby.yml") self.class.base_uri "https://#{config['subdomain']}.cybozu.com/v1/csv" @auth = Base64.encode64("#{config['login']}:#{config['password']}").chomp end |
Instance Method Details
#get(path) ⇒ Object
13 14 15 16 |
# File 'lib/cyby/user_api.rb', line 13 def get(path) = { headers: { AUTH => @auth } } self.class.get(path, ) end |
#group ⇒ Object
34 35 36 |
# File 'lib/cyby/user_api.rb', line 34 def group get("/group.csv") end |
#organization ⇒ Object
22 23 24 |
# File 'lib/cyby/user_api.rb', line 22 def organization get("/organization.csv") end |
#title ⇒ Object
26 27 28 |
# File 'lib/cyby/user_api.rb', line 26 def title get("/title.csv") end |
#user ⇒ Object
18 19 20 |
# File 'lib/cyby/user_api.rb', line 18 def user get("/user.csv") end |
#user_groups ⇒ Object
38 39 40 |
# File 'lib/cyby/user_api.rb', line 38 def user_groups get("/userGroups.csv") end |
#user_organizations ⇒ Object
30 31 32 |
# File 'lib/cyby/user_api.rb', line 30 def user_organizations get("/userOrganizations.csv") end |
#user_services ⇒ Object
42 43 44 |
# File 'lib/cyby/user_api.rb', line 42 def user_services get("/userServices.csv") end |