Class: MountainBerryFields::Parser::Recording
- Inherits:
-
Object
- Object
- MountainBerryFields::Parser::Recording
- Defined in:
- lib/mountain_berry_fields/parser.rb
Instance Method Summary collapse
- #command? ⇒ Boolean
-
#initialize(is_command, is_visible = true) ⇒ Recording
constructor
A new instance of Recording.
- #record(text) ⇒ Object
- #recorded ⇒ Object
- #visible? ⇒ Boolean
Constructor Details
#initialize(is_command, is_visible = true) ⇒ Recording
Returns a new instance of Recording.
18 19 20 21 |
# File 'lib/mountain_berry_fields/parser.rb', line 18 def initialize(is_command, is_visible=true) @is_command = is_command @is_visible = is_visible end |
Instance Method Details
#command? ⇒ Boolean
23 24 25 |
# File 'lib/mountain_berry_fields/parser.rb', line 23 def command? @is_command end |
#record(text) ⇒ Object
35 36 37 |
# File 'lib/mountain_berry_fields/parser.rb', line 35 def record(text) recorded << text if command? end |
#recorded ⇒ Object
31 32 33 |
# File 'lib/mountain_berry_fields/parser.rb', line 31 def recorded @recorded ||= '' end |
#visible? ⇒ Boolean
27 28 29 |
# File 'lib/mountain_berry_fields/parser.rb', line 27 def visible? @is_visible end |