Class: Narabi::Alias

Inherits:
Object
  • Object
show all
Defined in:
lib/narabi/parser.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeAlias

Returns a new instance of Alias.



72
73
74
# File 'lib/narabi/parser.rb', line 72

def initialize
  @aliases = {}
end

Class Method Details

.scope {|Narabi::Alias.new| ... } ⇒ Object

Yields:



93
94
95
# File 'lib/narabi/parser.rb', line 93

def self.scope
  yield Narabi::Alias.new
end

Instance Method Details

#parse_line_for_diagram(src) ⇒ Object



89
90
91
# File 'lib/narabi/parser.rb', line 89

def parse_line_for_diagram(src)
  Diagram.parse_line(src)
end

#parse_line_for_instance(src) ⇒ Object



76
77
78
79
80
81
# File 'lib/narabi/parser.rb', line 76

def parse_line_for_instance(src)
  if hash = Instance.parse_line(src)
    define_alias(hash)
  end
  hash
end

#parse_line_for_message(src) ⇒ Object



83
84
85
86
87
# File 'lib/narabi/parser.rb', line 83

def parse_line_for_message(src)
  if hash = Message.parse_line(src)
    return replace_alias(hash, [:from, :to])
  end
end