Class: AutoC::Parameter

Inherits:
Object
  • Object
show all
Defined in:
lib/autoc/function.rb

Overview

Function parameter

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value, name) ⇒ Parameter

Returns a new instance of Parameter.



59
60
61
62
# File 'lib/autoc/function.rb', line 59

def initialize(value, name)
  @value = value.to_value
  @name = name.to_sym
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



57
58
59
# File 'lib/autoc/function.rb', line 57

def name
  @name
end

#valueObject (readonly)

Returns the value of attribute value.



55
56
57
# File 'lib/autoc/function.rb', line 55

def value
  @value
end

Instance Method Details

#declarationObject



70
# File 'lib/autoc/function.rb', line 70

def declaration = '%s %s' % [signature, name]

#signatureObject



68
# File 'lib/autoc/function.rb', line 68

def signature = value.signature

#to_sObject



64
# File 'lib/autoc/function.rb', line 64

def to_s = name.to_s

#to_value_argumentObject



66
# File 'lib/autoc/function.rb', line 66

def to_value_argument = value.reference? ? "*#{name}" : name