Class: RelatonGb::GbStandardType

Inherits:
Object
  • Object
show all
Defined in:
lib/relaton_gb/gb_standard_type.rb

Overview

GB standard type.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(scope:, prefix:, mandate:, topic:) ⇒ GbStandardType

Returns a new instance of GbStandardType.

Parameters:

  • scope (String)
  • prefix (String)
  • mandate (String)
  • topic (String)


11
12
13
14
15
16
# File 'lib/relaton_gb/gb_standard_type.rb', line 11

def initialize(scope:, prefix:, mandate:, topic:)
  @scope   = scope
  @prefix  = prefix
  @mandate = mandate
  @topic   = topic
end

Instance Attribute Details

#mandateString (readonly)

Returns:

  • (String)


5
6
7
# File 'lib/relaton_gb/gb_standard_type.rb', line 5

def mandate
  @mandate
end

#prefixString (readonly)

Returns:

  • (String)


5
6
7
# File 'lib/relaton_gb/gb_standard_type.rb', line 5

def prefix
  @prefix
end

#scopeString (readonly)

Returns:

  • (String)


5
6
7
# File 'lib/relaton_gb/gb_standard_type.rb', line 5

def scope
  @scope
end

#topicString (readonly)

Returns:

  • (String)


5
6
7
# File 'lib/relaton_gb/gb_standard_type.rb', line 5

def topic
  @topic
end

Instance Method Details

#to_hashHash

Returns:

  • (Hash)


28
29
30
# File 'lib/relaton_gb/gb_standard_type.rb', line 28

def to_hash
  { "scope" => scope, "prefix" => prefix, "mandate" => mandate, "topic" => topic }
end

#to_xml(builder) ⇒ Object



18
19
20
21
22
23
24
25
# File 'lib/relaton_gb/gb_standard_type.rb', line 18

def to_xml(builder)
  builder.gbtype do
    builder.gbscope scope
    builder.gbprefix prefix
    builder.gbmandate mandate
    builder.gbtopic topic
  end
end