Class: BasicBlock::Alignment

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

Constant Summary collapse

ALIGNS =
%w[left right center justified].freeze

Instance Method Summary collapse

Constructor Details

#initialize(content) ⇒ Alignment

Returns a new instance of Alignment.

Parameters:

  • content (String)


8
9
10
11
12
13
# File 'lib/relaton_iec/basic_block/alignment.rb', line 8

def initialize(content)
  unless ALIGNS.include?(content)
    Util.warn "invalid alignment `#{content}`\nalloved aligments are: `#{ALIGNS.join '`, `'}`"
  end
  @content = content
end

Instance Method Details

#inspectString

Returns:

  • (String)


25
26
27
# File 'lib/relaton_iec/basic_block/alignment.rb', line 25

def inspect
  to_s
end

#to_sString

Returns:

  • (String)


18
19
20
# File 'lib/relaton_iec/basic_block/alignment.rb', line 18

def to_s
  @content
end