Class: RubyHeaderParser::TyperefDefinition

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

Overview

typeref definition for FunctionDefinition

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type:, pointer: nil) ⇒ TyperefDefinition

Returns a new instance of TyperefDefinition.

Parameters:

  • type (String)
  • pointer (Symbol, nil) (defaults to: nil)

    :ref, :raw



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

def initialize(type:, pointer: nil)
  @type = type
  @pointer = pointer
end

Instance Attribute Details

#pointerSymbol?

Returns :ref, :raw.

Returns:

  • (Symbol, nil)

    :ref, :raw



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

def pointer
  @pointer
end

#typeString

Returns:

  • (String)


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

def type
  @type
end

Instance Method Details

#==(other) ⇒ Boolean

Parameters:

Returns:

  • (Boolean)


28
29
30
# File 'lib/ruby_header_parser/typeref_definition.rb', line 28

def ==(other)
  other.is_a?(TyperefDefinition) && type == other.type && pointer == other.pointer
end

#pointer?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/ruby_header_parser/typeref_definition.rb', line 22

def pointer?
  !!pointer
end