Class: Daifuku::StrdefGenerator::StreamColumn

Inherits:
Object
  • Object
show all
Defined in:
lib/daifuku/strdef_generator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, type, length = nil) ⇒ StreamColumn

Returns a new instance of StreamColumn.



40
41
42
43
44
# File 'lib/daifuku/strdef_generator.rb', line 40

def initialize(name, type, length = nil)
  @name = name
  @type = type
  @length = length
end

Instance Attribute Details

#lengthObject (readonly)

Returns the value of attribute length.



48
49
50
# File 'lib/daifuku/strdef_generator.rb', line 48

def length
  @length
end

#nameObject (readonly)

Returns the value of attribute name.



46
47
48
# File 'lib/daifuku/strdef_generator.rb', line 46

def name
  @name
end

#typeObject (readonly)

Returns the value of attribute type.



47
48
49
# File 'lib/daifuku/strdef_generator.rb', line 47

def type
  @type
end

Instance Method Details

#strdefObject



50
51
52
53
54
55
56
# File 'lib/daifuku/strdef_generator.rb', line 50

def strdef
  if length
    "#{name}: !#{type} #{length}"
  else
    "#{name}: !#{type}"
  end
end