Class: AccessSchema::Expectation
- Inherits:
-
Object
- Object
- AccessSchema::Expectation
- Defined in:
- lib/access_schema/expectation.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#roles ⇒ Object
readonly
Returns the value of attribute roles.
Instance Method Summary collapse
- #for?(roles) ⇒ Boolean
-
#initialize(name, roles, options = {}) ⇒ Expectation
constructor
A new instance of Expectation.
Constructor Details
#initialize(name, roles, options = {}) ⇒ Expectation
Returns a new instance of Expectation.
7 8 9 10 11 |
# File 'lib/access_schema/expectation.rb', line 7 def initialize(name, roles, = {}) @name = name @roles = roles @options = end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/access_schema/expectation.rb', line 3 def name @name end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
5 6 7 |
# File 'lib/access_schema/expectation.rb', line 5 def @options end |
#roles ⇒ Object (readonly)
Returns the value of attribute roles.
4 5 6 |
# File 'lib/access_schema/expectation.rb', line 4 def roles @roles end |
Instance Method Details
#for?(roles) ⇒ Boolean
13 14 15 |
# File 'lib/access_schema/expectation.rb', line 13 def for?(roles) @roles.empty? || (@roles & roles).size > 0 end |