Class: Fatty::MenuEnv
- Inherits:
-
Object
- Object
- Fatty::MenuEnv
- Defined in:
- lib/fatty/menu_env.rb
Instance Attribute Summary collapse
-
#label ⇒ Object
readonly
Returns the value of attribute label.
-
#payload ⇒ Object
readonly
Returns the value of attribute payload.
-
#session ⇒ Object
readonly
Returns the value of attribute session.
-
#terminal ⇒ Object
readonly
Returns the value of attribute terminal.
Instance Method Summary collapse
-
#initialize(terminal:, session:, label: '', payload: nil) ⇒ MenuEnv
constructor
A new instance of MenuEnv.
- #output(text) ⇒ Object
- #status(text) ⇒ Object
Constructor Details
#initialize(terminal:, session:, label: '', payload: nil) ⇒ MenuEnv
Returns a new instance of MenuEnv.
7 8 9 10 11 12 |
# File 'lib/fatty/menu_env.rb', line 7 def initialize(terminal:, session:, label: '', payload: nil) @terminal = terminal @session = session @label = label @payload = payload end |
Instance Attribute Details
#label ⇒ Object (readonly)
Returns the value of attribute label.
5 6 7 |
# File 'lib/fatty/menu_env.rb', line 5 def label @label end |
#payload ⇒ Object (readonly)
Returns the value of attribute payload.
5 6 7 |
# File 'lib/fatty/menu_env.rb', line 5 def payload @payload end |
#session ⇒ Object (readonly)
Returns the value of attribute session.
5 6 7 |
# File 'lib/fatty/menu_env.rb', line 5 def session @session end |
#terminal ⇒ Object (readonly)
Returns the value of attribute terminal.
5 6 7 |
# File 'lib/fatty/menu_env.rb', line 5 def terminal @terminal end |
Instance Method Details
#output(text) ⇒ Object
14 15 16 |
# File 'lib/fatty/menu_env.rb', line 14 def output(text) session.output.append(text.to_s) end |
#status(text) ⇒ Object
18 19 20 |
# File 'lib/fatty/menu_env.rb', line 18 def status(text) terminal.set_status(text.to_s) end |