Module: HalApi::Representer::UriMethods::ClassMethods
- Defined in:
- lib/hal_api/representer/uri_methods.rb
Instance Attribute Summary collapse
-
#alternate_host ⇒ Object
Returns the value of attribute alternate_host.
-
#profile_host ⇒ Object
Returns the value of attribute profile_host.
Instance Method Summary collapse
Instance Attribute Details
#alternate_host ⇒ Object
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_host ⇒ Object
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
#alternate_link ⇒ Object
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 |
#profile_link ⇒ Object
21 22 23 |
# File 'lib/hal_api/representer/uri_methods.rb', line 21 def profile_link link(:profile) { model_uri(represented) } end |
#self_link ⇒ Object
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 |