Class: Pione::Location::BasicLocation
- Inherits:
-
Object
- Object
- Pione::Location::BasicLocation
- Defined in:
- lib/pione/location/basic-location.rb
Overview
BasicLocation is a class for all location classes.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#address ⇒ Object
readonly
Returns the value of attribute address.
Class Method Summary collapse
-
.location_type(name = nil) ⇒ void
Set location type.
Instance Method Summary collapse
- #==(other) ⇒ Object (also: #eql?) private
- #hash ⇒ Object private
-
#initialize(address) ⇒ BasicLocation
constructor
Create a location with the URI.
- #inspect ⇒ Object (also: #to_s) private
Constructor Details
#initialize(address) ⇒ BasicLocation
Create a location with the URI.
65 66 67 |
# File 'lib/pione/location/basic-location.rb', line 65 def initialize(address) @address = address end |
Instance Attribute Details
#address ⇒ Object (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.
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 |
#hash ⇒ Object
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 |
#inspect ⇒ Object 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 |