class Interscript::Node::MetaData

Attributes

data[RW]

Public Class Methods

new(data={}) click to toggle source
# File lib/interscript/node/metadata.rb, line 3
def initialize data={}
  @data = data
end

Public Instance Methods

==(other) click to toggle source
Calls superclass method Interscript::Node#==
# File lib/interscript/node/metadata.rb, line 20
def ==(other)
  super && self.data == other.data
end
[](k) click to toggle source
# File lib/interscript/node/metadata.rb, line 10
def [](k)
  @data[k]
end
[]=(k,v) click to toggle source
# File lib/interscript/node/metadata.rb, line 7
def []=(k,v)
  @data[k] = v
end
reverse() click to toggle source
# File lib/interscript/node/metadata.rb, line 14
def reverse
  self.class.new(data.dup, **{}).tap do |rmd|
    rmd[:source_script], rmd[:destination_script] = rmd[:destination_script], rmd[:source_script]
  end
end
to_hash() click to toggle source
# File lib/interscript/node/metadata.rb, line 24
def to_hash
  {:class => self.class.to_s,
    :data => @data}
end