Module: HALDecorator::Policy::DSL::ClassMethods
- Defined in:
- lib/hal_decorator/policy/dsl.rb
Instance Method Summary collapse
- #allow_by_default(*types) ⇒ Object
- #attribute(name) ⇒ Object
- #embed(name) ⇒ Object
- #link(rel) ⇒ Object
- #rules ⇒ Object
Instance Method Details
#allow_by_default(*types) ⇒ Object
55 56 57 |
# File 'lib/hal_decorator/policy/dsl.rb', line 55 def allow_by_default(*types) rules.defaults(*types, value: true) end |
#attribute(name) ⇒ Object
59 60 61 62 |
# File 'lib/hal_decorator/policy/dsl.rb', line 59 def attribute(name) b = block_given? ? Proc.new : Proc.new { true } rules.add_attribute(name, b) end |
#embed(name) ⇒ Object
69 70 71 72 |
# File 'lib/hal_decorator/policy/dsl.rb', line 69 def (name) b = block_given? ? Proc.new : Proc.new { true } rules.(name, b) end |
#link(rel) ⇒ Object
64 65 66 67 |
# File 'lib/hal_decorator/policy/dsl.rb', line 64 def link(rel) b = block_given? ? Proc.new : Proc.new { true } rules.add_link(rel, b) end |