Class: RgGen::CHeader::Utility::Declaration

Inherits:
Struct
  • Object
show all
Defined in:
lib/rggen/c_header/utility/declaration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#array_sizeObject

Returns the value of attribute array_size

Returns:

  • (Object)

    the current value of array_size



6
7
8
# File 'lib/rggen/c_header/utility/declaration.rb', line 6

def array_size
  @array_size
end

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



6
7
8
# File 'lib/rggen/c_header/utility/declaration.rb', line 6

def name
  @name
end

#typeObject

Returns the value of attribute type

Returns:

  • (Object)

    the current value of type



6
7
8
# File 'lib/rggen/c_header/utility/declaration.rb', line 6

def type
  @type
end

Instance Method Details

#to_sObject



7
8
9
10
11
# File 'lib/rggen/c_header/utility/declaration.rb', line 7

def to_s
  [
    type, ' ', name, array_size&.map { |size| "[#{size}]" }
  ].compact.join
end