Class: Fabriq::Skype::Message

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(room, body, from_name = "") ⇒ Message

Returns a new instance of Message.



7
8
9
10
11
# File 'lib/fabriq/skype/message.rb', line 7

def initialize(room, body, from_name = "")
  @room = room
  @body = body
  @from_name = from_name
end

Instance Attribute Details

#bodyObject

Returns the value of attribute body.



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

def body
  @body
end

#configObject

Returns the value of attribute config.



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

def config
  @config
end

#from_nameObject

Returns the value of attribute from_name.



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

def from_name
  @from_name
end

#roomObject

Returns the value of attribute room.



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

def room
  @room
end

Instance Method Details

#direct?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/fabriq/skype/message.rb', line 21

def direct?
  (self.config.skype_name && self.body.downcase.include?("@#{self.config.skype_name.downcase}")) == true
end

#private_session?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/fabriq/skype/message.rb', line 17

def private_session?
  self.room.private_session?
end