Class: Ast::Merge::MergeIR

Inherits:
Struct
  • Object
show all
Defined in:
lib/ast/merge.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#changesObject

Returns the value of attribute changes

Returns:

  • (Object)

    the current value of changes



177
178
179
# File 'lib/ast/merge.rb', line 177

def changes
  @changes
end

#diagnosticsObject

Returns the value of attribute diagnostics

Returns:

  • (Object)

    the current value of diagnostics



177
178
179
# File 'lib/ast/merge.rb', line 177

def diagnostics
  @diagnostics
end

#node_classesObject

Returns the value of attribute node_classes

Returns:

  • (Object)

    the current value of node_classes



177
178
179
# File 'lib/ast/merge.rb', line 177

def node_classes
  @node_classes
end

#ordered_nodesObject

Returns the value of attribute ordered_nodes

Returns:

  • (Object)

    the current value of ordered_nodes



177
178
179
# File 'lib/ast/merge.rb', line 177

def ordered_nodes
  @ordered_nodes
end

#sourceObject

Returns the value of attribute source

Returns:

  • (Object)

    the current value of source



177
178
179
# File 'lib/ast/merge.rb', line 177

def source
  @source
end

#tree_idObject

Returns the value of attribute tree_id

Returns:

  • (Object)

    the current value of tree_id



177
178
179
# File 'lib/ast/merge.rb', line 177

def tree_id
  @tree_id
end

#versionObject

Returns the value of attribute version

Returns:

  • (Object)

    the current value of version



177
178
179
# File 'lib/ast/merge.rb', line 177

def version
  @version
end

Instance Method Details

#to_hObject



179
180
181
182
183
184
185
186
187
188
189
# File 'lib/ast/merge.rb', line 179

def to_h
  {
    version: version,
    tree_id: tree_id,
    source: source,
    node_classes: (node_classes || []).map(&:to_h),
    ordered_nodes: (ordered_nodes || []).map(&:to_h),
    changes: (changes || []).map(&:to_h),
    diagnostics: diagnostics || []
  }
end