Module: Railjet::Policy
Defined Under Namespace
Modules: ClassMethods
Instance Attribute Summary collapse
-
#context ⇒ Object
readonly
Returns the value of attribute context.
-
#object ⇒ Object
readonly
Returns the value of attribute object.
Instance Method Summary collapse
Instance Attribute Details
#context ⇒ Object (readonly)
Returns the value of attribute context.
6 7 8 |
# File 'lib/railjet/policy.rb', line 6 def context @context end |
#object ⇒ Object (readonly)
Returns the value of attribute object.
6 7 8 |
# File 'lib/railjet/policy.rb', line 6 def object @object end |
Instance Method Details
#initialize(context, object) ⇒ Object
8 9 10 |
# File 'lib/railjet/policy.rb', line 8 def initialize(context, object) @context, @object = context, object end |
#validate! ⇒ Object
12 13 14 |
# File 'lib/railjet/policy.rb', line 12 def validate! valid? || (raise Railjet::PolicyError.new(errors) ) end |