Class: Redminerb::Users
- Inherits:
-
Object
- Object
- Redminerb::Users
- Defined in:
- lib/redminerb/users.rb
Overview
Users resource wrapper
Class Method Summary collapse
-
.create(params) ⇒ Object
Creates a brand new user with the given params.
-
.list(params) ⇒ Object
Get the users of our Redmine as OpenStruct objects.
-
.me ⇒ Object
Returns a hash with the info of the user’s account behind the API key that is used by the script to access the Redmine’s REST API.
- .read(id) ⇒ Object
Class Method Details
.create(params) ⇒ Object
32 33 34 35 36 37 38 39 40 |
# File 'lib/redminerb/users.rb', line 32 def create(params) response = Redminerb.client.post_json('/users.json', user: params) if response.success? 'Created' else Redminerb::Client.raise_error! response end end |
.list(params) ⇒ Object
18 19 20 21 22 |
# File 'lib/redminerb/users.rb', line 18 def list(params) Redminerb.client.get_json('/users.json', params)['users'].map do |user| OpenStruct.new user end end |