Module: HALDecorator::Links
- Included in:
- HALDecorator, Collection::CollectionParameters
- Defined in:
- lib/hal_decorator/links.rb
Defined Under Namespace
Classes: Link
Instance Method Summary collapse
Instance Method Details
#link(rel, value = nil, method: nil, methods: nil, &block) ⇒ Object
32 33 34 35 36 |
# File 'lib/hal_decorator/links.rb', line 32 def link(rel, value = nil, method: nil, methods: nil, &block) @_links ||= init_links @_links = @_links.reject { |link| link.rel == rel } @_links << Link.new(rel, value, http_method: method || methods, &block) end |