Class: AutoC::Parameter
- Inherits:
-
Object
- Object
- AutoC::Parameter
- Defined in:
- lib/autoc/function.rb
Overview
Function parameter
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #declaration ⇒ Object
-
#initialize(value, name) ⇒ Parameter
constructor
A new instance of Parameter.
- #signature ⇒ Object
- #to_s ⇒ Object
- #to_value_argument ⇒ Object
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
#name ⇒ Object (readonly)
Returns the value of attribute name.
57 58 59 |
# File 'lib/autoc/function.rb', line 57 def name @name end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
55 56 57 |
# File 'lib/autoc/function.rb', line 55 def value @value end |
Instance Method Details
#declaration ⇒ Object
70 |
# File 'lib/autoc/function.rb', line 70 def declaration = '%s %s' % [signature, name] |
#signature ⇒ Object
68 |
# File 'lib/autoc/function.rb', line 68 def signature = value.signature |
#to_s ⇒ Object
64 |
# File 'lib/autoc/function.rb', line 64 def to_s = name.to_s |
#to_value_argument ⇒ Object
66 |
# File 'lib/autoc/function.rb', line 66 def to_value_argument = value.reference? ? "*#{name}" : name |