Class: Almodovar::ResourcePresenter::Link::Serializer
- Inherits:
-
Object
- Object
- Almodovar::ResourcePresenter::Link::Serializer
- Defined in:
- lib/almodovar-server/resource_presenter/link.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#link ⇒ Object
readonly
Returns the value of attribute link.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
- #dont_expand_link! ⇒ Object
- #expands? ⇒ Boolean
-
#initialize(link, options) ⇒ Serializer
constructor
A new instance of Serializer.
Constructor Details
#initialize(link, options) ⇒ Serializer
Returns a new instance of Serializer.
44 45 46 47 |
# File 'lib/almodovar-server/resource_presenter/link.rb', line 44 def initialize(link, ) @link = link @options = end |
Instance Attribute Details
#link ⇒ Object (readonly)
Returns the value of attribute link.
42 43 44 |
# File 'lib/almodovar-server/resource_presenter/link.rb', line 42 def link @link end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
42 43 44 |
# File 'lib/almodovar-server/resource_presenter/link.rb', line 42 def @options end |
Instance Method Details
#dont_expand_link! ⇒ Object
55 56 57 |
# File 'lib/almodovar-server/resource_presenter/link.rb', line 55 def ([:dont_expand] ||= []) << link.href end |
#expands? ⇒ Boolean
49 50 51 52 53 |
# File 'lib/almodovar-server/resource_presenter/link.rb', line 49 def link. && Array([:expand]).include?(link.rel) && !Array([:dont_expand]).include?(link.href) end |