Class: Vangrail::Colang::Program
- Inherits:
-
Struct
- Object
- Struct
- Vangrail::Colang::Program
- Defined in:
- lib/vangrail/colang/ast.rb
Overview
The whole grammar this gem executes, as data. Everything the parser can produce is one of these, which is also the honest statement of what a Colang file may contain here: anything else is refused at parse time rather than skipped at run time.
Instance Attribute Summary collapse
-
#bot_messages ⇒ Object
Returns the value of attribute bot_messages.
-
#flows ⇒ Object
Returns the value of attribute flows.
-
#user_messages ⇒ Object
Returns the value of attribute user_messages.
Instance Method Summary collapse
Instance Attribute Details
#bot_messages ⇒ Object
Returns the value of attribute bot_messages
9 10 11 |
# File 'lib/vangrail/colang/ast.rb', line 9 def @bot_messages end |
#flows ⇒ Object
Returns the value of attribute flows
9 10 11 |
# File 'lib/vangrail/colang/ast.rb', line 9 def flows @flows end |
#user_messages ⇒ Object
Returns the value of attribute user_messages
9 10 11 |
# File 'lib/vangrail/colang/ast.rb', line 9 def @user_messages end |
Instance Method Details
#bot_message(name) ⇒ Object
18 19 20 |
# File 'lib/vangrail/colang/ast.rb', line 18 def (name) [name.to_s] end |
#flow(name) ⇒ Object
10 11 12 |
# File 'lib/vangrail/colang/ast.rb', line 10 def flow(name) flows[name.to_s] end |
#flow_names ⇒ Object
14 15 16 |
# File 'lib/vangrail/colang/ast.rb', line 14 def flow_names flows.keys end |
#merge(other) ⇒ Object
22 23 24 25 26 27 28 |
# File 'lib/vangrail/colang/ast.rb', line 22 def merge(other) Program.new( flows: flows.merge(other.flows), bot_messages: .merge(other.), user_messages: .merge(other.), ) end |