Class: Pione::Location::BasicLocation

Inherits:
Object
  • Object
show all
Defined in:
lib/pione/location/basic-location.rb

Overview

BasicLocation is a class for all location classes.

Direct Known Subclasses

DataLocation, GitRepositoryLocation

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(address) ⇒ BasicLocation

Create a location with the URI.

Parameters:

  • uri (URI)

    location URI



65
66
67
# File 'lib/pione/location/basic-location.rb', line 65

def initialize(address)
  @address = address
end

Instance Attribute Details

#addressObject (readonly)

Returns the value of attribute address.



59
60
61
# File 'lib/pione/location/basic-location.rb', line 59

def address
  @address
end

Class Method Details

.location_type(name = nil) ⇒ void

This method returns an undefined value.

Set location type.

Parameters:

  • name (Symbol) (defaults to: nil)

    location type name



49
50
51
52
53
54
55
# File 'lib/pione/location/basic-location.rb', line 49

def location_type(name=nil)
  if name
    @location_type = name
  else
    @location_type ? @location_type : superclass.location_type
  end
end

Instance Method Details

#==(other) ⇒ Object Also known as: eql?

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



76
77
78
79
# File 'lib/pione/location/basic-location.rb', line 76

def ==(other)
  return false unless other.kind_of?(self.class)
  @address == other.address
end

#hashObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



83
84
85
# File 'lib/pione/location/basic-location.rb', line 83

def hash
  @address.hash
end

#inspectObject Also known as: to_s

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



70
71
72
# File 'lib/pione/location/basic-location.rb', line 70

def inspect
  "#<%s %s>" % [self.class, address]
end