Class: RubyHeaderParser::EnumDefinition

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_header_parser/enum_definition.rb

Overview

enum definition in header file

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, values: []) ⇒ EnumDefinition

Returns a new instance of EnumDefinition.

Parameters:

  • name (String)
  • values (Array<String>) (defaults to: [])


16
17
18
19
# File 'lib/ruby_header_parser/enum_definition.rb', line 16

def initialize(name:, values: [])
  @name = name
  @values = values
end

Instance Attribute Details

#nameString

Returns:

  • (String)


8
9
10
# File 'lib/ruby_header_parser/enum_definition.rb', line 8

def name
  @name
end

#valuesArray<String>

Returns:

  • (Array<String>)


12
13
14
# File 'lib/ruby_header_parser/enum_definition.rb', line 12

def values
  @values
end

Instance Method Details

#==(other) ⇒ Boolean

Parameters:

Returns:

  • (Boolean)


23
24
25
# File 'lib/ruby_header_parser/enum_definition.rb', line 23

def ==(other)
  other.is_a?(EnumDefinition) && name == other.name && values == other.values
end