Module: Ruby::Merge::SignatureSupport

Defined in:
lib/ruby/merge/signature_support.rb

Class Method Summary collapse

Class Method Details

.begin_block(first_statement_preview) ⇒ Object



52
53
54
# File 'lib/ruby/merge/signature_support.rb', line 52

def begin_block(first_statement_preview)
  [:begin, first_statement_preview || '']
end

.call(method_name, identifier, block: false) ⇒ Object



56
57
58
# File 'lib/ruby/merge/signature_support.rb', line 56

def call(method_name, identifier, block: false)
  [block ? :call_with_block : :call, method_name, identifier]
end

.call_operator_write(write_name, receiver) ⇒ Object



68
69
70
# File 'lib/ruby/merge/signature_support.rb', line 68

def call_operator_write(write_name, receiver)
  [:call_op_write, write_name, receiver]
end

.case_match_statement(predicate) ⇒ Object



44
45
46
# File 'lib/ruby/merge/signature_support.rb', line 44

def case_match_statement(predicate)
  [:case_match, predicate || '']
end

.case_statement(predicate) ⇒ Object



40
41
42
# File 'lib/ruby/merge/signature_support.rb', line 40

def case_statement(predicate)
  [:case, predicate || '']
end

.class_definition(constant_path) ⇒ Object



12
13
14
# File 'lib/ruby/merge/signature_support.rb', line 12

def class_definition(constant_path)
  [:class, constant_path]
end

.conditional(kind, predicate) ⇒ Object



36
37
38
# File 'lib/ruby/merge/signature_support.rb', line 36

def conditional(kind, predicate)
  [kind, predicate]
end

.constant(name) ⇒ Object



24
25
26
# File 'lib/ruby/merge/signature_support.rb', line 24

def constant(name)
  [:const, name]
end

.embedded(statements_source) ⇒ Object



84
85
86
# File 'lib/ruby/merge/signature_support.rb', line 84

def embedded(statements_source)
  [:embedded, statements_source || '']
end

.execution_block(kind, line_number) ⇒ Object



76
77
78
# File 'lib/ruby/merge/signature_support.rb', line 76

def execution_block(kind, line_number)
  [kind, line_number]
end

.forwarding_super_call(block:) ⇒ Object



64
65
66
# File 'lib/ruby/merge/signature_support.rb', line 64

def forwarding_super_call(block:)
  [:forwarding_super, block ? :with_block : :no_block]
end

.lambda_literal(parameters_source) ⇒ Object



72
73
74
# File 'lib/ruby/merge/signature_support.rb', line 72

def lambda_literal(parameters_source)
  [:lambda, parameters_source || '']
end

.loop_statement(kind, *parts) ⇒ Object



48
49
50
# File 'lib/ruby/merge/signature_support.rb', line 48

def loop_statement(kind, *parts)
  [kind, *parts]
end

.method_definition(name, params) ⇒ Object



8
9
10
# File 'lib/ruby/merge/signature_support.rb', line 8

def method_definition(name, params)
  [:def, name, Array(params)]
end

.module_definition(constant_path) ⇒ Object



16
17
18
# File 'lib/ruby/merge/signature_support.rb', line 16

def module_definition(constant_path)
  [:module, constant_path]
end

.multi_write(targets) ⇒ Object



32
33
34
# File 'lib/ruby/merge/signature_support.rb', line 32

def multi_write(targets)
  [:multi_write, Array(targets)]
end

.other(class_name, line_number) ⇒ Object



88
89
90
# File 'lib/ruby/merge/signature_support.rb', line 88

def other(class_name, line_number)
  [:other, class_name, line_number]
end

.parenthesized(first_expression_preview) ⇒ Object



80
81
82
# File 'lib/ruby/merge/signature_support.rb', line 80

def parenthesized(first_expression_preview)
  [:parens, first_expression_preview || '']
end

.singleton_class(expression) ⇒ Object



20
21
22
# File 'lib/ruby/merge/signature_support.rb', line 20

def singleton_class(expression)
  [:singleton_class, expression]
end

.super_call(block:) ⇒ Object



60
61
62
# File 'lib/ruby/merge/signature_support.rb', line 60

def super_call(block:)
  [:super, block ? :with_block : :no_block]
end

.textual_method_signature(receiver_prefix, method_name) ⇒ Object



92
93
94
# File 'lib/ruby/merge/signature_support.rb', line 92

def textual_method_signature(receiver_prefix, method_name)
  "#{receiver_prefix}#{method_name}"
end

.variable_assignment(kind, name) ⇒ Object



28
29
30
# File 'lib/ruby/merge/signature_support.rb', line 28

def variable_assignment(kind, name)
  [kind, name]
end