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.
9 10 11 |
# File 'lib/hal_api/representer/uri_methods.rb', line 9 def alternate_host @alternate_host end |
#profile_host ⇒ Object
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
#alternate_link ⇒ Object
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 |
#profile_link ⇒ Object
20 21 22 |
# File 'lib/hal_api/representer/uri_methods.rb', line 20 def profile_link link(:profile) { profile_url(represented) } end |
#self_link ⇒ Object
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 |