Class: Fatty::ActionEnvironment
- Inherits:
-
Object
- Object
- Fatty::ActionEnvironment
- Defined in:
- lib/fatty/action_environment.rb
Overview
For holding the environment in which an action is executed
Instance Attribute Summary collapse
-
#buffer ⇒ Object
Returns the value of attribute buffer.
-
#counter ⇒ Object
Returns the value of attribute counter.
-
#event ⇒ Object
Returns the value of attribute event.
-
#field ⇒ Object
Returns the value of attribute field.
-
#pager ⇒ Object
Returns the value of attribute pager.
-
#session ⇒ Object
Returns the value of attribute session.
Instance Method Summary collapse
-
#initialize(session: nil, terminal: nil, counter: nil, event: nil, buffer: nil, field: nil, pager: nil) ⇒ ActionEnvironment
constructor
A new instance of ActionEnvironment.
- #terminal ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(session: nil, terminal: nil, counter: nil, event: nil, buffer: nil, field: nil, pager: nil) ⇒ ActionEnvironment
Returns a new instance of ActionEnvironment.
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/fatty/action_environment.rb', line 8 def initialize( session: nil, terminal: nil, counter: nil, event: nil, buffer: nil, field: nil, pager: nil ) @session = session @terminal = terminal @counter = counter @event = event @buffer = buffer @field = field @pager = pager end |
Instance Attribute Details
#buffer ⇒ Object
Returns the value of attribute buffer.
6 7 8 |
# File 'lib/fatty/action_environment.rb', line 6 def buffer @buffer end |
#counter ⇒ Object
Returns the value of attribute counter.
6 7 8 |
# File 'lib/fatty/action_environment.rb', line 6 def counter @counter end |
#event ⇒ Object
Returns the value of attribute event.
6 7 8 |
# File 'lib/fatty/action_environment.rb', line 6 def event @event end |
#field ⇒ Object
Returns the value of attribute field.
6 7 8 |
# File 'lib/fatty/action_environment.rb', line 6 def field @field end |
#pager ⇒ Object
Returns the value of attribute pager.
6 7 8 |
# File 'lib/fatty/action_environment.rb', line 6 def pager @pager end |
#session ⇒ Object
Returns the value of attribute session.
6 7 8 |
# File 'lib/fatty/action_environment.rb', line 6 def session @session end |
Instance Method Details
#terminal ⇒ Object
26 27 28 |
# File 'lib/fatty/action_environment.rb', line 26 def terminal session&.terminal end |
#to_s ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/fatty/action_environment.rb', line 30 def to_s parts = [] parts << "session: #{session}" if session parts << "terminal: #{terminal}" if terminal parts << "counter: #{counter}" if counter parts << "event: #{event.to_s[0..90]}" if event parts << "buffer: #{buffer}" if buffer parts << "field: #{field}" if field parts << "pager: #{pager}" if pager parts.join('; ') end |