Class: Renderer::Entities::MethodArgument

Inherits:
Object
  • Object
show all
Defined in:
lib/renderer/entities/method_argument.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#nameObject

Returns the value of attribute name.



6
7
8
# File 'lib/renderer/entities/method_argument.rb', line 6

def name
  @name
end

#parentObject

Returns the value of attribute parent.



6
7
8
# File 'lib/renderer/entities/method_argument.rb', line 6

def parent
  @parent
end

#typeObject

Returns the value of attribute type.



6
7
8
# File 'lib/renderer/entities/method_argument.rb', line 6

def type
  @type
end

#valueObject

Returns the value of attribute value.



6
7
8
# File 'lib/renderer/entities/method_argument.rb', line 6

def value
  @value
end

#value_typeObject

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

Returns:

  • (Boolean)


24
# File 'lib/renderer/entities/method_argument.rb', line 24

def block? = type == :blockarg

#kwarg?Boolean

Returns:

  • (Boolean)


20
# File 'lib/renderer/entities/method_argument.rb', line 20

def kwarg? = type == :kwarg || type == :kwoptarg

#optional?Boolean

Returns:

  • (Boolean)


18
# File 'lib/renderer/entities/method_argument.rb', line 18

def optional? = type == :optarg || type == :kwoptarg

#positional?Boolean

Returns:

  • (Boolean)


16
# File 'lib/renderer/entities/method_argument.rb', line 16

def positional? = type == :arg || type == :optarg

#rest?Boolean

Returns:

  • (Boolean)


22
# File 'lib/renderer/entities/method_argument.rb', line 22

def rest? = type == :restarg || type == :kwrestarg