Class: MountainBerryFields::Parser::Recording

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

Instance Method Summary collapse

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

Returns:

  • (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

#recordedObject


31
32
33
# File 'lib/mountain_berry_fields/parser.rb', line 31

def recorded
  @recorded ||= ''
end

#visible?Boolean

Returns:

  • (Boolean)

27
28
29
# File 'lib/mountain_berry_fields/parser.rb', line 27

def visible?
  @is_visible
end