Class: Renderer::Entities::MethodArgument
- Defined in:
- lib/renderer/entities/method_argument.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#parent ⇒ Object
Returns the value of attribute parent.
-
#type ⇒ Object
Returns the value of attribute type.
-
#value ⇒ Object
Returns the value of attribute value.
-
#value_type ⇒ Object
Returns the value of attribute value_type.
Instance Method Summary collapse
- #block? ⇒ Boolean
-
#initialize(parent, arg) ⇒ MethodArgument
constructor
A new instance of MethodArgument.
- #kwarg? ⇒ Boolean
- #optional? ⇒ Boolean
- #positional? ⇒ Boolean
- #rest? ⇒ Boolean
Constructor Details
#initialize(parent, arg) ⇒ MethodArgument
Returns a new instance of MethodArgument.
8 9 10 11 12 13 14 |
# File 'lib/renderer/entities/method_argument.rb', line 8 def initialize(parent, arg) @parent = parent @name = arg[:name] @type = arg[:type].to_sym @value = arg[:value] @value_type = arg[:value_type] end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
6 7 8 |
# File 'lib/renderer/entities/method_argument.rb', line 6 def name @name end |
#parent ⇒ Object
Returns the value of attribute parent.
6 7 8 |
# File 'lib/renderer/entities/method_argument.rb', line 6 def parent @parent end |
#type ⇒ Object
Returns the value of attribute type.
6 7 8 |
# File 'lib/renderer/entities/method_argument.rb', line 6 def type @type end |
#value ⇒ Object
Returns the value of attribute value.
6 7 8 |
# File 'lib/renderer/entities/method_argument.rb', line 6 def value @value end |
#value_type ⇒ Object
Returns the value of attribute value_type.
6 7 8 |
# File 'lib/renderer/entities/method_argument.rb', line 6 def value_type @value_type end |
Instance Method Details
#block? ⇒ Boolean
24 |
# File 'lib/renderer/entities/method_argument.rb', line 24 def block? = type == :blockarg |
#kwarg? ⇒ Boolean
20 |
# File 'lib/renderer/entities/method_argument.rb', line 20 def kwarg? = type == :kwarg || type == :kwoptarg |
#optional? ⇒ Boolean
18 |
# File 'lib/renderer/entities/method_argument.rb', line 18 def optional? = type == :optarg || type == :kwoptarg |
#positional? ⇒ Boolean
16 |
# File 'lib/renderer/entities/method_argument.rb', line 16 def positional? = type == :arg || type == :optarg |
#rest? ⇒ Boolean
22 |
# File 'lib/renderer/entities/method_argument.rb', line 22 def rest? = type == :restarg || type == :kwrestarg |