Module: HalApi::Representer::UriMethods::ClassMethods

Defined in:
lib/hal_api/representer/uri_methods.rb

Instance Method Summary collapse

Instance Method Details



28
29
30
31
32
33
34
35
# File 'lib/hal_api/representer/uri_methods.rb', line 28

def alternate_link
  link :alternate do
    {
      href: alternate_url(model_path(represented)),
      type: 'text/html'
    }
  end
end


24
25
26
# File 'lib/hal_api/representer/uri_methods.rb', line 24

def profile_link
  link(:profile) { profile_url(represented) }
end


15
16
17
18
19
20
21
22
# File 'lib/hal_api/representer/uri_methods.rb', line 15

def self_link
  link(:self) do
    {
      href: self_url(represented),
      profile: profile_url(represented)
    }
  end
end