Skip to content

Commit

Permalink
Add roles resource (#10)
Browse files Browse the repository at this point in the history
* Add roles resource

* Include resource and update version

* Add new lines for rubocop
  • Loading branch information
lawyu89 committed Jan 11, 2018
1 parent 0481932 commit 0b7ba75
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 2 deletions.
1 change: 1 addition & 0 deletions lib/frederick_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
require 'frederick_api/v2/contact_list'
require 'frederick_api/v2/contact_type'
require 'frederick_api/v2/interaction'
require 'frederick_api/v2/role'

# Namespace for all Frederick API client methods/classes
module FrederickAPI
Expand Down
10 changes: 10 additions & 0 deletions lib/frederick_api/v2/role.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# frozen_string_literal: true

module FrederickAPI
module V2
# /v2/users
class Role < Resource
has_many :users
end
end
end
2 changes: 1 addition & 1 deletion lib/frederick_api/v2/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module FrederickAPI
module V2
# /v2/users
class User < Resource
has_many :roles
has_many :roles, class_name: 'FrederickAPI::V2::Role'
end
end
end
2 changes: 1 addition & 1 deletion lib/frederick_api/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

module FrederickAPI
# Current gem version
VERSION = '0.4.3'
VERSION = '0.4.4'
end
11 changes: 11 additions & 0 deletions spec/frederick_api/v2/role_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# frozen_string_literal: true

require 'spec_helper'

module FrederickAPI::V2
RSpec.describe Role do
describe 'superclass' do
it_behaves_like 'v2_resource'
end
end
end

0 comments on commit 0b7ba75

Please sign in to comment.