Class: AuthRocket::Invitation
- Inherits:
-
Resource
- Object
- Resource
- AuthRocket::Invitation
- Defined in:
- lib/authrocket/invitation.rb
Instance Attribute Summary collapse
-
#email ⇒ Object
readonly
Returns the value of attribute email.
-
#invitation_type ⇒ Object
readonly
Returns the value of attribute invitation_type.
-
#locale ⇒ Object
readonly
Returns the value of attribute locale.
-
#permissions ⇒ Object
readonly
Returns the value of attribute permissions.
-
#token ⇒ Object
readonly
Returns the value of attribute token.
Instance Method Summary collapse
Instance Attribute Details
#email ⇒ Object (readonly)
Returns the value of attribute email.
11 12 13 |
# File 'lib/authrocket/invitation.rb', line 11 def email @email end |
#invitation_type ⇒ Object (readonly)
Returns the value of attribute invitation_type.
11 12 13 |
# File 'lib/authrocket/invitation.rb', line 11 def invitation_type @invitation_type end |
#locale ⇒ Object (readonly)
Returns the value of attribute locale.
11 12 13 |
# File 'lib/authrocket/invitation.rb', line 11 def locale @locale end |
#permissions ⇒ Object (readonly)
Returns the value of attribute permissions.
12 13 14 |
# File 'lib/authrocket/invitation.rb', line 12 def @permissions end |
#token ⇒ Object (readonly)
Returns the value of attribute token.
11 12 13 |
# File 'lib/authrocket/invitation.rb', line 11 def token @token end |
Instance Method Details
#any_permission?(*perms) ⇒ Boolean
15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/authrocket/invitation.rb', line 15 def (*perms) perms.any? do |p| case p when String .include? p when Regexp .any?{|m| p =~ m} else false end end end |
#invite(attribs = {}) ⇒ Object
28 29 30 31 32 33 |
# File 'lib/authrocket/invitation.rb', line 28 def invite(attribs={}) params = parse_request_params(attribs, json_root: json_root).reverse_merge credentials: api_creds parsed, _ = request(:post, resource_path+'/invite', params) load(parsed) errors.empty? ? self : false end |