Class: HALPresenter::Curies::Curie

Inherits:
Property
  • Object
show all
Defined in:
lib/hal_presenter/curies.rb

Instance Attribute Summary

Attributes inherited from Property

#embed_depth, #name

Instance Method Summary collapse

Methods inherited from Property

#change_context, #initialize, #value

Constructor Details

This class inherits a constructor from HALPresenter::Property

Instance Method Details

#to_h(resource = nil, options = {}) ⇒ Object



9
10
11
12
13
14
15
16
17
18
# File 'lib/hal_presenter/curies.rb', line 9

def to_h(resource = nil, options = {})
  href = value(resource, options)
  return {} unless href

  {
    name: name,
    href: HALPresenter.href(href),
    templated: true
  }
end