Class Jabber::UserLocation::Location
In: lib/xmpp4r/location/location.rb
Parent: XMPPElement
Message Presence XMPPStanza Iq XMPPElement ErrorResponse X IqQuery JabberError ComponentAuthenticationFailure ArgumentError InvalidChatState SOCKS5Error ServerError NoNameXmlnsRegistered ServerDisconnected ClientAuthenticationFailure Connection Client Component Connection Client Singleton IdGenerator Comparable JID Enumerable CallbackList Items Publish StandardError REXML::Element Stream XMPPElement Location IqFeature StreamHost IqSiFile IqSiFileRange IqSi StreamHostUsed XRosterItem RosterItem C Body HTML UserItem XMUCUserInvite Configuration Retract IqPubSub Item IqPubSubOwner Event Subscription Unsubscribe Tune XDataField XDataReported XDataTitle XDataInstructions Feature Item Identity IqVcard PubSub::ServiceHelper Helper Helper SOCKS5Bytestreams SOCKS5BytestreamsTarget SOCKS5BytestreamsInitiator SOCKS5BytestreamsServerStreamHost TCPSocket SOCKS5Socket IqQuery IqQueryBytestreams IqQueryRoster IqQueryVersion IqQueryRPC IqQueryMUCOwner IqQueryMUCAdmin IqQueryDiscoItems IqQueryDiscoInfo IqQueryLastActivity IBB IBBTarget IBBInitiator RosterXItem XRoster RosterX X XDelay XMUC XMUCUser XData Responder SimpleResponder Iq IqCommand XMLRPC::ParserWriterChooseMixin Client Server XMLRPC::ParseContentType XMLRPC::BasicServer MUCClient SimpleMUCClient MUC::UserItem XMUCUserItem IqQueryMUCAdminItem XParent SubscriptionConfig NodeConfig OwnerNodeConfig EventItems ServiceHelper OAuthServiceHelper NodeHelper EventItem Base Anonymous DigestMD5 Plain FileSource Base Bot Callback StreamParser Semaphore SOCKS5BytestreamsPeer SOCKS5BytestreamsServer IBBQueueItem Helper Responder Helper Listener MUCBrowser NodeBrowser ListenerMocker Helper Responder Helper Helper Helper lib/xmpp4r/message.rb lib/xmpp4r/connection.rb lib/xmpp4r/xmppstanza.rb lib/xmpp4r/iq.rb lib/xmpp4r/callbacks.rb lib/xmpp4r/idgenerator.rb lib/xmpp4r/stream.rb lib/xmpp4r/client.rb lib/xmpp4r/jid.rb lib/xmpp4r/x.rb lib/xmpp4r/streamparser.rb lib/xmpp4r/semaphore.rb lib/xmpp4r/errors.rb lib/xmpp4r/component.rb lib/xmpp4r/presence.rb lib/xmpp4r/xmppelement.rb lib/xmpp4r/query.rb XParent lib/xmpp4r/location/helper/helper.rb lib/xmpp4r/location/location.rb UserLocation lib/xmpp4r/feature_negotiation/iq/feature.rb FeatureNegotiation lib/xmpp4r/bytestreams/iq/si.rb lib/xmpp4r/bytestreams/helper/ibb/initiator.rb lib/xmpp4r/bytestreams/helper/socks5bytestreams/base.rb lib/xmpp4r/bytestreams/iq/bytestreams.rb lib/xmpp4r/bytestreams/helper/socks5bytestreams/initiator.rb lib/xmpp4r/bytestreams/helper/socks5bytestreams/target.rb lib/xmpp4r/bytestreams/helper/socks5bytestreams/socks5.rb lib/xmpp4r/bytestreams/helper/ibb/target.rb lib/xmpp4r/bytestreams/helper/socks5bytestreams/server.rb lib/xmpp4r/bytestreams/helper/ibb/base.rb Bytestreams lib/xmpp4r/roster/x/roster.rb lib/xmpp4r/roster/helper/roster.rb lib/xmpp4r/roster/iq/roster.rb Roster lib/xmpp4r/version/helper/responder.rb lib/xmpp4r/version/helper/simpleresponder.rb lib/xmpp4r/version/iq/version.rb Version lib/xmpp4r/command/iq/command.rb lib/xmpp4r/command/helper/responder.rb Command lib/xmpp4r/caps/helper/helper.rb lib/xmpp4r/caps/c.rb Caps lib/xmpp4r/reliable.rb Reliable lib/xmpp4r/delay/x/delay.rb Delay lib/xmpp4r/xhtml/html.rb XHTML lib/xmpp4r/rpc/helper/server.rb lib/xmpp4r/rpc/helper/client.rb lib/xmpp4r/rpc/iq/rpc.rb RPC lib/xmpp4r/muc/iq/mucadminitem.rb lib/xmpp4r/muc/x/muc.rb lib/xmpp4r/muc/item.rb lib/xmpp4r/muc/helper/simplemucclient.rb lib/xmpp4r/muc/iq/mucadmin.rb lib/xmpp4r/muc/helper/mucbrowser.rb lib/xmpp4r/muc/x/mucuseritem.rb lib/xmpp4r/muc/x/mucuserinvite.rb lib/xmpp4r/muc/iq/mucowner.rb lib/xmpp4r/muc/helper/mucclient.rb MUC lib/xmpp4r/pubsub/children/item.rb lib/xmpp4r/pubsub/children/configuration.rb lib/xmpp4r/pubsub/children/subscription.rb lib/xmpp4r/pubsub/helper/servicehelper.rb lib/xmpp4r/pubsub/children/unsubscribe.rb lib/xmpp4r/pubsub/children/publish.rb lib/xmpp4r/pubsub/helper/oauth_service_helper.rb lib/xmpp4r/pubsub/children/event.rb lib/xmpp4r/pubsub/iq/pubsub.rb lib/xmpp4r/pubsub/children/retract.rb lib/xmpp4r/pubsub/helper/nodebrowser.rb lib/xmpp4r/pubsub/helper/nodehelper.rb lib/xmpp4r/pubsub/children/items.rb lib/xmpp4r/pubsub/children/subscription_config.rb lib/xmpp4r/pubsub/children/node_config.rb OAuthPubSubStreamHelper PubSub lib/xmpp4r/httpbinding/client.rb HTTPBinding lib/xmpp4r/tune/helper/helper.rb lib/xmpp4r/tune/tune.rb UserTune lib/xmpp4r/sasl.rb SASL lib/xmpp4r/test/listener_mocker.rb Test lib/xmpp4r/dataforms/x/data.rb Dataforms lib/xmpp4r/discovery/helper/helper.rb lib/xmpp4r/discovery/iq/discoinfo.rb lib/xmpp4r/discovery/helper/responder.rb lib/xmpp4r/discovery/iq/discoitems.rb Discovery lib/xmpp4r/bytestreams/helper/filetransfer.rb TransferSource FileTransfer lib/xmpp4r/last/helper/helper.rb lib/xmpp4r/last/iq/last.rb LastActivity lib/xmpp4r/framework/base.rb lib/xmpp4r/framework/bot.rb Framework lib/xmpp4r/vcard/helper/vcard.rb lib/xmpp4r/vcard/iq/vcard.rb Vcard Jabber dot/m_110_0.png

The <geoloc> XMPP element, as defined in XEP-0080 User Location

See xmpp.org/extensions/xep-0080.html - this element encapsulates data about a user‘s current location. These are expressed as child elements such as <locality>, <lat>, etc. which are also managed by this class.

If the element has no children then it indicates that the user has stopped publishing their location.

Methods

accuracy   alt   area   bearing   building   country   datum   description   floor   lat   locality   lon   new   postalcode   published?   region   room   speed   street   text   timestamp   uri  

Public Class methods

Construct a new <location> element.

Supply no arguments to make an empty element to indicate that location is no longer being published.

attributes:[Hash] location attributes

[Source]

    # File lib/xmpp4r/location/location.rb, line 37
37:       def initialize(attributes = {})
38:         super()
39: 
40:         # validate attributes
41:         attributes = attributes.select do |k,v|
42:           ALLOWABLE_ATTRIBUTES.include?(k) && !v.nil?
43:         end
44: 
45:         attributes.each do |k,v|
46:           v = x.xmlschema if v.is_a?(Time)
47:           add_element(REXML::Element.new(k)).text = v.to_s
48:         end
49:       end

Public Instance methods

Get the accuracy attribute of this location.

[Source]

    # File lib/xmpp4r/location/location.rb, line 60
60:       def accuracy
61:         first_element('accuracy').text if first_element('accuracy')
62:       end

Get the alt attribute of this location.

[Source]

    # File lib/xmpp4r/location/location.rb, line 66
66:       def alt
67:         first_element('alt').text if first_element('alt')
68:       end

Get the area attribute of this location.

[Source]

    # File lib/xmpp4r/location/location.rb, line 72
72:       def area
73:         first_element('area').text if first_element('area')
74:       end

Get the bearing attribute of this location.

[Source]

    # File lib/xmpp4r/location/location.rb, line 78
78:       def bearing
79:         first_element('bearing').text if first_element('bearing')
80:       end

Get the building attribute of this location.

[Source]

    # File lib/xmpp4r/location/location.rb, line 84
84:       def building
85:         first_element('building').text if first_element('building')
86:       end

Get the country attribute of this location.

[Source]

    # File lib/xmpp4r/location/location.rb, line 90
90:       def country
91:         first_element('country').text if first_element('country')
92:       end

Get the datum attribute of this location.

[Source]

    # File lib/xmpp4r/location/location.rb, line 96
96:       def datum
97:         first_element('datum').text if first_element('datum')
98:       end

Get the description attribute of this location.

[Source]

     # File lib/xmpp4r/location/location.rb, line 102
102:       def description
103:         first_element('description').text if first_element('description')
104:       end

Get the floor attribute of this location.

[Source]

     # File lib/xmpp4r/location/location.rb, line 108
108:       def floor
109:         first_element('floor').text if first_element('floor')
110:       end

Get the lat attribute of this location.

[Source]

     # File lib/xmpp4r/location/location.rb, line 114
114:       def lat
115:         first_element('lat').text if first_element('lat')
116:       end

Get the locality attribute of this location.

[Source]

     # File lib/xmpp4r/location/location.rb, line 120
120:       def locality
121:         first_element('locality').text if first_element('locality')
122:       end

Get the lon attribute of this location.

[Source]

     # File lib/xmpp4r/location/location.rb, line 126
126:       def lon
127:         first_element('lon').text if first_element('lon')
128:       end

Get the postalcode attribute of this location.

[Source]

     # File lib/xmpp4r/location/location.rb, line 132
132:       def postalcode
133:         first_element('postalcode').text if first_element('postalcode')
134:       end

Returns true if a location is currently being published, otherwise false.

[Source]

    # File lib/xmpp4r/location/location.rb, line 54
54:       def published?
55:         (elements.size > 0)
56:       end

Get the region attribute of this location.

[Source]

     # File lib/xmpp4r/location/location.rb, line 138
138:       def region
139:         first_element('region').text if first_element('region')
140:       end

Get the room attribute of this location.

[Source]

     # File lib/xmpp4r/location/location.rb, line 144
144:       def room
145:         first_element('room').text if first_element('room')
146:       end

Get the speed attribute of this location.

[Source]

     # File lib/xmpp4r/location/location.rb, line 150
150:       def speed
151:         first_element('speed').text if first_element('speed')
152:       end

Get the street attribute of this location.

[Source]

     # File lib/xmpp4r/location/location.rb, line 156
156:       def street
157:         first_element('street').text if first_element('street')
158:       end

Get the text attribute of this location.

[Source]

     # File lib/xmpp4r/location/location.rb, line 162
162:       def text
163:         first_element('text').text if first_element('text')
164:       end

Get the timestamp attribute of this location.

[Source]

     # File lib/xmpp4r/location/location.rb, line 168
168:       def timestamp
169:         first_element('timestamp').text if first_element('timestamp')
170:       end

Get the uri attribute of this location.

[Source]

     # File lib/xmpp4r/location/location.rb, line 174
174:       def uri
175:         first_element('uri').text if first_element('uri')
176:       end

[Validate]