Class: Parser::Source::Map::MethodDefinition

Inherits:
Parser::Source::Map show all
Defined in:
lib/parser/source/map/method_definition.rb

Instance Attribute Summary collapse

Attributes inherited from Parser::Source::Map

#expression, #node

Instance Method Summary collapse

Methods inherited from Parser::Source::Map

#==, #column, #last_column, #last_line, #line, #to_hash

Constructor Details

#initialize(keyword_l, operator_l, name_l, end_l, assignment_l, body_l) ⇒ MethodDefinition

Returns a new instance of MethodDefinition.


13
14
15
16
17
18
19
20
21
# File 'lib/parser/source/map/method_definition.rb', line 13

def initialize(keyword_l, operator_l, name_l, end_l, assignment_l, body_l)
  @keyword  = keyword_l
  @operator = operator_l
  @name     = name_l
  @end      = end_l
  @assignment = assignment_l

  super(@keyword.join(end_l || body_l))
end

Instance Attribute Details

#assignmentObject (readonly)


11
12
13
# File 'lib/parser/source/map/method_definition.rb', line 11

def assignment
  @assignment
end

#endObject (readonly)


10
11
12
# File 'lib/parser/source/map/method_definition.rb', line 10

def end
  @end
end

#keywordObject (readonly)


7
8
9
# File 'lib/parser/source/map/method_definition.rb', line 7

def keyword
  @keyword
end

#nameObject (readonly)


9
10
11
# File 'lib/parser/source/map/method_definition.rb', line 9

def name
  @name
end

#operatorObject (readonly)


8
9
10
# File 'lib/parser/source/map/method_definition.rb', line 8

def operator
  @operator
end