Class: Xrc::Messages::Subject

Inherits:
Base
  • Object
show all
Defined in:
lib/xrc/messages/subject.rb

Instance Attribute Summary

Attributes inherited from Base

#element

Instance Method Summary collapse

Methods inherited from Base

#delayed?, #from, #initialize, #to, #type

Constructor Details

This class inherits a constructor from Xrc::Messages::Base

Instance Method Details

#subjectString

Returns the message subject (e.g. Room1)

Examples:

message.subject #=> "Room1"

Returns:

  • (String)


8
9
10
# File 'lib/xrc/messages/subject.rb', line 8

def subject
  @element.elements["subject/text()"].to_s
end

#to_hashHash

Returns this message in Hash format

Examples:

message.to_hash #=> {
  :from    => "[email protected]",
  :subject => "Room1",
  :to      => "[email protected]",
}

Returns:

  • (Hash)


20
21
22
23
24
25
26
# File 'lib/xrc/messages/subject.rb', line 20

def to_hash
  {
    from: from,
    to: to,
    subject: subject,
  }
end