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.



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

def alternate_host
  @alternate_host
end

#profile_hostObject

Returns the value of attribute profile_host.



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

def profile_host
  @profile_host
end

Instance Method Details



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

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


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

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


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

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