Class: Dialekt::Util::CallSignature::Parameter

Inherits:
Object
  • Object
show all
Defined in:
lib/dialekt/util/call_signature.rb

Overview

Parameter information

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, optional:) ⇒ Parameter

Returns a new instance of Parameter.



11
12
13
14
# File 'lib/dialekt/util/call_signature.rb', line 11

def initialize(name:, optional:)
  @name = name.to_sym
  @optional = optional
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



9
10
11
# File 'lib/dialekt/util/call_signature.rb', line 9

def name
  @name
end

Instance Method Details

#==(other) ⇒ Object



20
21
22
# File 'lib/dialekt/util/call_signature.rb', line 20

def ==(other)
  @name == other.name && @optional == other.optional?
end

#optional?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/dialekt/util/call_signature.rb', line 16

def optional?
  @optional
end