Class: IsbmAdaptor::Message

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id, content, topics) ⇒ Message

Creates a new ISBM Message container.

Parameters:

  • id (String)

    message id

  • content (Nokogiri::XML::Document)

    XML content

  • topics (Array<String>, String)

    collection of topics or single topic



17
18
19
20
21
# File 'lib/isbm_adaptor/message.rb', line 17

def initialize(id, content, topics)
  @id = id
  @content = content
  @topics = [topics].flatten
end

Instance Attribute Details

#contentNokogiri::XML::Document

Returns the XML content of the message.

Returns:

  • (Nokogiri::XML::Document)

    the XML content of the message



7
8
9
# File 'lib/isbm_adaptor/message.rb', line 7

def content
  @content
end

#idString

Returns the id of the message.

Returns:

  • (String)

    the id of the message



4
5
6
# File 'lib/isbm_adaptor/message.rb', line 4

def id
  @id
end

#topicsArray<String>

Returns topics associated with the message.

Returns:

  • (Array<String>)

    topics associated with the message



10
11
12
# File 'lib/isbm_adaptor/message.rb', line 10

def topics
  @topics
end