Class: Restful::ApiModel::Link
- Defined in:
- lib/restful/apimodel/link.rb
Instance Attribute Summary collapse
-
#base ⇒ Object
Returns the value of attribute base.
-
#path ⇒ Object
Returns the value of attribute path.
Attributes inherited from Attribute
#extended_type, #name, #type, #value
Instance Method Summary collapse
- #full_url ⇒ Object
-
#initialize(name, base, path, extended_type) ⇒ Link
constructor
A new instance of Link.
Constructor Details
#initialize(name, base, path, extended_type) ⇒ Link
Returns a new instance of Link.
9 10 11 12 13 14 |
# File 'lib/restful/apimodel/link.rb', line 9 def initialize(name, base, path, extended_type) self.base = base self.path = path super(name, self.full_url, extended_type) self.type = :link end |
Instance Attribute Details
#base ⇒ Object
Returns the value of attribute base.
7 8 9 |
# File 'lib/restful/apimodel/link.rb', line 7 def base @base end |
#path ⇒ Object
Returns the value of attribute path.
7 8 9 |
# File 'lib/restful/apimodel/link.rb', line 7 def path @path end |
Instance Method Details
#full_url ⇒ Object
16 17 18 |
# File 'lib/restful/apimodel/link.rb', line 16 def full_url base.blank? ? path : "#{ base }#{ path }" end |