Class: RubyHeaderParser::ArgumentDefinition
- Inherits:
-
Object
- Object
- RubyHeaderParser::ArgumentDefinition
- Defined in:
- lib/ruby_header_parser/argument_definition.rb
Overview
argument definition for FunctionDefinition
Instance Attribute Summary collapse
- #length ⇒ Integer
- #name ⇒ String
-
#pointer ⇒ Symbol?
:ref, :array.
- #type ⇒ String
Instance Method Summary collapse
- #==(other) ⇒ Boolean
-
#initialize(type:, name:, pointer: nil, length: 0) ⇒ ArgumentDefinition
constructor
A new instance of ArgumentDefinition.
- #pointer? ⇒ Boolean
Constructor Details
#initialize(type:, name:, pointer: nil, length: 0) ⇒ ArgumentDefinition
Returns a new instance of ArgumentDefinition.
26 27 28 29 30 31 |
# File 'lib/ruby_header_parser/argument_definition.rb', line 26 def initialize(type:, name:, pointer: nil, length: 0) @type = type @name = name @pointer = pointer @length = length end |
Instance Attribute Details
#length ⇒ Integer
20 21 22 |
# File 'lib/ruby_header_parser/argument_definition.rb', line 20 def length @length end |
#name ⇒ String
12 13 14 |
# File 'lib/ruby_header_parser/argument_definition.rb', line 12 def name @name end |
#pointer ⇒ Symbol?
Returns :ref, :array.
16 17 18 |
# File 'lib/ruby_header_parser/argument_definition.rb', line 16 def pointer @pointer end |
#type ⇒ String
8 9 10 |
# File 'lib/ruby_header_parser/argument_definition.rb', line 8 def type @type end |
Instance Method Details
#==(other) ⇒ Boolean
35 36 37 38 |
# File 'lib/ruby_header_parser/argument_definition.rb', line 35 def ==(other) other.is_a?(ArgumentDefinition) && type == other.type && name == other.name && pointer == other.pointer && length == other.length end |
#pointer? ⇒ Boolean
41 42 43 |
# File 'lib/ruby_header_parser/argument_definition.rb', line 41 def pointer? !!pointer end |