Class: OneLogin::Api::Models::Statement
- Inherits:
-
Object
- Object
- OneLogin::Api::Models::Statement
- Defined in:
- lib/onelogin/api/models/statement.rb
Instance Attribute Summary collapse
-
#actions ⇒ Object
Returns the value of attribute actions.
-
#effect ⇒ Object
Returns the value of attribute effect.
-
#scopes ⇒ Object
Returns the value of attribute scopes.
Instance Method Summary collapse
- #from_data(data) ⇒ Object
- #from_values(effect, actions, scopes) ⇒ Object
- #get_valid_actions ⇒ Object
-
#initialize(*args) ⇒ Statement
constructor
A new instance of Statement.
Constructor Details
#initialize(*args) ⇒ Statement
Returns a new instance of Statement.
9 10 11 12 13 14 15 |
# File 'lib/onelogin/api/models/statement.rb', line 9 def initialize(*args) if args.length == 1 self.from_data(args[0]) else self.from_values(args[0], args[1], args[2]) end end |
Instance Attribute Details
#actions ⇒ Object
Returns the value of attribute actions.
7 8 9 |
# File 'lib/onelogin/api/models/statement.rb', line 7 def actions @actions end |
#effect ⇒ Object
Returns the value of attribute effect.
7 8 9 |
# File 'lib/onelogin/api/models/statement.rb', line 7 def effect @effect end |
#scopes ⇒ Object
Returns the value of attribute scopes.
7 8 9 |
# File 'lib/onelogin/api/models/statement.rb', line 7 def scopes @scopes end |
Instance Method Details
#from_data(data) ⇒ Object
17 18 19 20 21 |
# File 'lib/onelogin/api/models/statement.rb', line 17 def from_data(data) @effect = data['Effect']? data['Effect'] : "Allow" @actions = data['Action']? data['Action'] : [] @scopes = data['Scope']? data['Scope'] : [] end |
#from_values(effect, actions, scopes) ⇒ Object
23 24 25 26 27 |
# File 'lib/onelogin/api/models/statement.rb', line 23 def from_values(effect, actions, scopes) @effect = effect @actions = actions @scopes = scopes end |
#get_valid_actions ⇒ Object
29 30 31 32 |
# File 'lib/onelogin/api/models/statement.rb', line 29 def get_valid_actions return Constants.VALID_ACTIONS end |