Class: Laser::Analysis::Bindings::ArgumentBinding

Inherits:
Base
  • Object
show all
Defined in:
lib/laser/analysis/bindings.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#annotated_type, #ast_node, #definition, #inferred_type, #name, #self_owner, #uses, #value

Instance Method Summary collapse

Methods inherited from Base

#<=>, #bind!, #class_used, #expr_type, #initialize_dup_deep, #inspect, #scope, #to_s

Methods included from Comparable

#<, #<=, #==, #>, #>=, #between?, compare_int

Constructor Details

#initialize(name, value, kind, default_value = nil) ⇒ ArgumentBinding



118
119
120
121
122
# File 'lib/laser/analysis/bindings.rb', line 118

def initialize(name, value, kind, default_value = nil)
  super(name, value)
  @kind = kind
  @default_value_sexp = default_value
end

Instance Attribute Details

#default_value_sexpObject (readonly)

Returns the value of attribute default_value_sexp



117
118
119
# File 'lib/laser/analysis/bindings.rb', line 117

def default_value_sexp
  @default_value_sexp
end

#kindObject (readonly)

Returns the value of attribute kind



117
118
119
# File 'lib/laser/analysis/bindings.rb', line 117

def kind
  @kind
end

Instance Method Details

#deep_dupObject



124
125
126
127
# File 'lib/laser/analysis/bindings.rb', line 124

def deep_dup
  result = self.class.new(@name, @value, @kind, @default_value_sexp)
  result.initialize_dup_deep(self)
end

#is_block?Boolean



138
139
140
# File 'lib/laser/analysis/bindings.rb', line 138

def is_block?
  :block == @kind
end

#is_optional?Boolean



132
133
134
# File 'lib/laser/analysis/bindings.rb', line 132

def is_optional?
  :optional == @kind
end

#is_positional?Boolean



129
130
131
# File 'lib/laser/analysis/bindings.rb', line 129

def is_positional?
  :positional == @kind
end

#is_rest?Boolean



135
136
137
# File 'lib/laser/analysis/bindings.rb', line 135

def is_rest?
  :rest == @kind
end