Class: RelatonIec::ReferenceFormat

Inherits:
Object
  • Object
show all
Defined in:
lib/relaton_iec/basic_block/reference_format.rb

Constant Summary collapse

FORMATS =
%w[external inline footnote callout].freeze

Instance Method Summary collapse

Constructor Details

#initialize(format) ⇒ ReferenceFormat

Returns a new instance of ReferenceFormat.

Parameters:

  • format (String)


16
17
18
19
20
21
22
# File 'lib/relaton_iec/basic_block/reference_format.rb', line 16

def initialize(format)
  unless FORMATS.include? format
    Util.warn "Invalid reference format: `#{format}`\n" \
      "Alloved reference formats are: `#{FORMATS.join '`, `'}`"
  end
  @format = format
end

Instance Method Details

#inspectSting

Returns <description>.

Returns:

  • (Sting)

    <description>



34
35
36
# File 'lib/relaton_iec/basic_block/reference_format.rb', line 34

def inspect
  to_s
end

#to_sString

Returns:

  • (String)


27
28
29
# File 'lib/relaton_iec/basic_block/reference_format.rb', line 27

def to_s
  @format
end