Module: ParamsReady::Restriction::Wrapper
- Extended by:
- Forwardable
- Included in:
- Intent, QueryContext
- Defined in:
- lib/params_ready/restriction.rb
Instance Attribute Summary collapse
-
#restriction ⇒ Object
readonly
Returns the value of attribute restriction.
Instance Method Summary collapse
- #delegate(*args) ⇒ Object
- #for_children(parameter) ⇒ Object
- #permit(*list) ⇒ Object
- #permit_all ⇒ Object
- #prohibit(*list) ⇒ Object
- #to_restriction ⇒ Object
Instance Attribute Details
#restriction ⇒ Object (readonly)
Returns the value of attribute restriction.
5 6 7 |
# File 'lib/params_ready/restriction.rb', line 5 def restriction @restriction end |
Instance Method Details
#delegate(*args) ⇒ Object
8 9 10 11 12 13 |
# File 'lib/params_ready/restriction.rb', line 8 def delegate(*args) return self if @restriction.everything? new_restriction = @restriction.delegate(*args) clone(restriction: new_restriction) end |
#for_children(parameter) ⇒ Object
15 16 17 18 19 20 |
# File 'lib/params_ready/restriction.rb', line 15 def for_children(parameter) return self if @restriction.everything? new_restriction = @restriction.for_children parameter clone(restriction: new_restriction) end |
#permit(*list) ⇒ Object
28 29 30 31 32 33 |
# File 'lib/params_ready/restriction.rb', line 28 def permit(*list) restriction = Restriction.permit(*list) return self if @restriction.everything? && restriction.everything? clone(restriction: restriction) end |
#permit_all ⇒ Object
22 23 24 25 26 |
# File 'lib/params_ready/restriction.rb', line 22 def permit_all return self if @restriction.everything? clone(restriction: Restriction.) end |
#prohibit(*list) ⇒ Object
35 36 37 38 39 40 |
# File 'lib/params_ready/restriction.rb', line 35 def prohibit(*list) restriction = Restriction.prohibit(*list) return self if @restriction.everything? && restriction.everything? clone(restriction: restriction) end |
#to_restriction ⇒ Object
42 43 44 |
# File 'lib/params_ready/restriction.rb', line 42 def to_restriction @restriction end |