Class: Cloudability::Organizations
- Inherits:
-
Object
- Object
- Cloudability::Organizations
- Includes:
- HTTParty
- Defined in:
- lib/cloudability/organizations.rb
Instance Attribute Summary collapse
-
#auth_token ⇒ Object
Returns the value of attribute auth_token.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Organizations
constructor
A new instance of Organizations.
- #invitations ⇒ Object
-
#invite_user(args) ⇒ Object
Invite a user to your organization.
- #my_organization ⇒ Object
- #roles ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Organizations
Returns a new instance of Organizations.
9 10 11 12 13 |
# File 'lib/cloudability/organizations.rb', line 9 def initialize(={}) raise ArgumentError, "You must provide an auth token" if [:auth_token].nil? @auth_token = [:auth_token] end |
Instance Attribute Details
#auth_token ⇒ Object
Returns the value of attribute auth_token.
7 8 9 |
# File 'lib/cloudability/organizations.rb', line 7 def auth_token @auth_token end |
Instance Method Details
#invitations ⇒ Object
20 21 22 23 |
# File 'lib/cloudability/organizations.rb', line 20 def invitations response = get_url("/organizations/invitations?auth_token=#{@auth_token}") convert_to_mashes(response) end |
#invite_user(args) ⇒ Object
Invite a user to your organization
36 37 38 39 40 41 |
# File 'lib/cloudability/organizations.rb', line 36 def invite_user(args) raise ArgumentError, "You must provide an email" if args[:email].nil? response = post_url("/organizations/invitations?auth_token=#{@auth_token}", args) Hashie::Mash.new(response) end |
#my_organization ⇒ Object
15 16 17 18 |
# File 'lib/cloudability/organizations.rb', line 15 def my_organization response = get_url("/organizations?auth_token=#{@auth_token}") Hashie::Mash.new(response) end |
#roles ⇒ Object
25 26 27 28 |
# File 'lib/cloudability/organizations.rb', line 25 def roles response = get_url("/organizations/roles?auth_token=#{@auth_token}") convert_to_mashes(response) end |