Class: XwotDiscovery::Message

Inherits:
Object
  • Object
show all
Defined in:
lib/xwot_discovery/message.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(a_hash) ⇒ Message

Returns a new instance of Message.



8
9
10
11
12
13
14
15
16
17
# File 'lib/xwot_discovery/message.rb', line 8

def initialize(a_hash)
  @method = a_hash[:method]
  @location = a_hash[:location]
  @content_type = a_hash[:content_type]
  @payload = a_hash[:payload]
  @protocol = a_hash[:protocol] || ''
  @urn = a_hash[:urn]
  @host = a_hash[:host]
  @hostname = a_hash[:hostname]
end

Instance Attribute Details

#content_typeObject (readonly)

Returns the value of attribute content_type.



5
6
7
# File 'lib/xwot_discovery/message.rb', line 5

def content_type
  @content_type
end

#hostObject (readonly)

Returns the value of attribute host.



5
6
7
# File 'lib/xwot_discovery/message.rb', line 5

def host
  @host
end

#hostnameObject (readonly)

Returns the value of attribute hostname.



5
6
7
# File 'lib/xwot_discovery/message.rb', line 5

def hostname
  @hostname
end

#locationObject (readonly)

Returns the value of attribute location.



5
6
7
# File 'lib/xwot_discovery/message.rb', line 5

def location
  @location
end

#methodObject (readonly)

Returns the value of attribute method.



5
6
7
# File 'lib/xwot_discovery/message.rb', line 5

def method
  @method
end

#payloadObject (readonly)

Returns the value of attribute payload.



5
6
7
# File 'lib/xwot_discovery/message.rb', line 5

def payload
  @payload
end

#protocolObject (readonly)

Returns the value of attribute protocol.



5
6
7
# File 'lib/xwot_discovery/message.rb', line 5

def protocol
  @protocol
end

#urnObject (readonly)

Returns the value of attribute urn.



5
6
7
# File 'lib/xwot_discovery/message.rb', line 5

def urn
  @urn
end