Class: AgentXmpp::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/agent_xmpp/client/response.rb

Overview


Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(msg, &blk) ⇒ Response

.….….….….….….….….….….….….….….….….….….….….….….….….….….



16
17
18
19
20
# File 'lib/agent_xmpp/client/response.rb', line 16

def initialize(msg, &blk)
  @message = msg
  @text = msg.to_s
  @responds_with = blk
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(meth, *args, &blk) ⇒ Object

.….….….….….….….….….….….….….….….….….….….….….….….….….….



28
29
30
# File 'lib/agent_xmpp/client/response.rb', line 28

def method_missing(meth, *args, &blk)
  text.send(meth, *args, &blk)
end

Instance Attribute Details

#messageObject (readonly)

.….….….….….….….….….….….….….….….….….….….….….….….….….….



13
14
15
# File 'lib/agent_xmpp/client/response.rb', line 13

def message
  @message
end

#responds_withObject (readonly)

.….….….….….….….….….….….….….….….….….….….….….….….….….….



13
14
15
# File 'lib/agent_xmpp/client/response.rb', line 13

def responds_with
  @responds_with
end

#textObject (readonly)

.….….….….….….….….….….….….….….….….….….….….….….….….….….



13
14
15
# File 'lib/agent_xmpp/client/response.rb', line 13

def text
  @text
end

Instance Method Details

#to_sObject

.….….….….….….….….….….….….….….….….….….….….….….….….….….



23
24
25
# File 'lib/agent_xmpp/client/response.rb', line 23

def to_s
  text
end