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

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#alternate_hostObject

Returns the value of attribute alternate_host.



9
10
11
# File 'lib/hal_api/representer/uri_methods.rb', line 9

def alternate_host
  @alternate_host
end

#profile_hostObject

Returns the value of attribute profile_host.



9
10
11
# File 'lib/hal_api/representer/uri_methods.rb', line 9

def profile_host
  @profile_host
end

Instance Method Details



24
25
26
27
28
29
30
31
# File 'lib/hal_api/representer/uri_methods.rb', line 24

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


20
21
22
# File 'lib/hal_api/representer/uri_methods.rb', line 20

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


11
12
13
14
15
16
17
18
# File 'lib/hal_api/representer/uri_methods.rb', line 11

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