Class: Decode::Comment::Parameter
- Defined in:
- lib/decode/comment/parameter.rb
Overview
Describes a named method parameter.
-
‘@parameter age [Float] The users age.`
Constant Summary collapse
- PATTERN =
/\A(?<name>.*?)\s+\[(?<type>.*?)\](\s+(?<details>.*?))?\Z/
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
The name of the parameter.
-
#type ⇒ Object
readonly
The type of the attribute.
Attributes inherited from Tag
Attributes inherited from Node
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(directive, name, type) ⇒ Parameter
constructor
A new instance of Parameter.
Methods inherited from Tag
Methods inherited from Node
#add, #children?, #each, #filter, #text, #traverse
Constructor Details
#initialize(directive, name, type) ⇒ Parameter
Returns a new instance of Parameter.
27 28 29 30 31 32 |
# File 'lib/decode/comment/parameter.rb', line 27 def initialize(directive, name, type) super(directive) @name = name @type = type end |
Instance Attribute Details
#name ⇒ Object (readonly)
The name of the parameter.
36 37 38 |
# File 'lib/decode/comment/parameter.rb', line 36 def name @name end |
#type ⇒ Object (readonly)
The type of the attribute.
40 41 42 |
# File 'lib/decode/comment/parameter.rb', line 40 def type @type end |