Class: Interscript::Node::AliasDef

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, data) ⇒ AliasDef

Returns a new instance of AliasDef.



4
5
6
7
8
# File 'lib/interscript/node/alias_def.rb', line 4

def initialize(name, data)
  data = Interscript::Node::Item.try_convert(data)
  @name = name
  @data = data
end

Instance Attribute Details

#dataObject

Returns the value of attribute data.



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

def data
  @data
end

#doc_nameObject

Returns the value of attribute doc_name.



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

def doc_name
  @doc_name
end

#nameObject

Returns the value of attribute name.



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

def name
  @name
end

Instance Method Details

#==(other) ⇒ Object



10
11
12
13
14
# File 'lib/interscript/node/alias_def.rb', line 10

def ==(other)
  super &&
  self.name == other.name &&
  self.data == other.data
end

#to_hashObject



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

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