Class: Daifuku::StrdefGenerator::LogColumn

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, is_common = false) ⇒ LogColumn

Returns a new instance of LogColumn.



96
97
98
99
100
# File 'lib/daifuku/strdef_generator.rb', line 96

def initialize(name, type, is_common = false)
  @name = name
  @type = type
  @is_common = is_common
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



102
103
104
# File 'lib/daifuku/strdef_generator.rb', line 102

def name
  @name
end

#typeObject (readonly)

Returns the value of attribute type.



103
104
105
# File 'lib/daifuku/strdef_generator.rb', line 103

def type
  @type
end

Instance Method Details

#common?Boolean

Returns:

  • (Boolean)


105
106
107
# File 'lib/daifuku/strdef_generator.rb', line 105

def common?
  @is_common
end

#strdefObject



109
110
111
112
113
114
115
# File 'lib/daifuku/strdef_generator.rb', line 109

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