Class: Interscript::Node::Dependency

Inherits:
Interscript::Node show all
Defined in:
lib/interscript/node/dependency.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeDependency

Returns a new instance of Dependency.



4
5
# File 'lib/interscript/node/dependency.rb', line 4

def initialize
end

Instance Attribute Details

#documentObject

Returns the value of attribute document.



2
3
4
# File 'lib/interscript/node/dependency.rb', line 2

def document
  @document
end

#full_nameObject

Returns the value of attribute full_name.



2
3
4
# File 'lib/interscript/node/dependency.rb', line 2

def full_name
  @full_name
end

#importObject

Returns the value of attribute import.



2
3
4
# File 'lib/interscript/node/dependency.rb', line 2

def import
  @import
end

#nameObject

Returns the value of attribute name.



2
3
4
# File 'lib/interscript/node/dependency.rb', line 2

def name
  @name
end

Instance Method Details

#==(other) ⇒ Object



16
17
18
19
20
21
# File 'lib/interscript/node/dependency.rb', line 16

def ==(other)
  super &&
  self.full_name == other.full_name &&
  self.import == other.import &&
  self.name == other.name
end

#reverseObject



7
8
9
10
11
12
13
14
# File 'lib/interscript/node/dependency.rb', line 7

def reverse
  rdep = self.class.new
  rdep.name = name
  rdep.full_name = Interscript::Node::Document.reverse_name(full_name)
  rdep.import = import
  rdep.document = document&.reverse
  rdep
end

#to_hashObject



23
24
25
26
27
28
# File 'lib/interscript/node/dependency.rb', line 23

def to_hash
  { :class => self.class.to_s,
    :name => @name,
    :full_name => @full_name,
    :import => @import }
end