Module: Occi::Core::Helpers::Locatable

Included in:
Entity, Kind, Mixin
Defined in:
lib/occi/core/helpers/locatable.rb

Overview

Introduces location-based capabilities to every receiver class. Provides methods to access set location value and generate default locations if necessary.

Author:

Instance Method Summary collapse

Instance Method Details

#locationURI

Returns the location of this instance. Set location is preferred over the generated one. If no location is known one is generated from available information specific to this instance.

Examples:

obj.location # => #<URI::Generic /my_location/>

Returns:

  • (URI)

    instance location


19
20
21
# File 'lib/occi/core/helpers/locatable.rb', line 19

def location
  @location || generate_location
end