Class: Toolbelt::Policy
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
#required_options, #validate_options!
Constructor Details
#initialize(options = {}) ⇒ Policy
Returns a new instance of Policy.
15
16
17
18
|
# File 'lib/toolbelt/policy.rb', line 15
def initialize(options = {})
validate_options!(options)
@options = Hashie::Mash.new(options)
end
|
Instance Attribute Details
#options ⇒ Object
Returns the value of attribute options.
5
6
7
|
# File 'lib/toolbelt/policy.rb', line 5
def options
@options
end
|
Class Method Details
.fail?(options = {}) ⇒ Boolean
11
12
13
|
# File 'lib/toolbelt/policy.rb', line 11
def self.fail?(options = {})
new(options).fail?
end
|
.pass?(options = {}) ⇒ Boolean
7
8
9
|
# File 'lib/toolbelt/policy.rb', line 7
def self.pass?(options = {})
new(options).pass?
end
|
Instance Method Details
#fail? ⇒ Boolean
24
25
26
|
# File 'lib/toolbelt/policy.rb', line 24
def fail?
!pass?
end
|