Class: Botz::DefinitionFile
- Inherits:
-
Object
- Object
- Botz::DefinitionFile
- Defined in:
- lib/botz/definition_file.rb
Overview
botz interface binding
Instance Attribute Summary collapse
-
#definition ⇒ Object
readonly
Returns the value of attribute definition.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Class Method Summary collapse
Instance Method Summary collapse
- #console ⇒ Object
-
#eval_definition ⇒ Object
rubocop:disable Security/Eval.
-
#shell ⇒ Object
rubocop:enable Security/Eval.
Instance Attribute Details
#definition ⇒ Object (readonly)
Returns the value of attribute definition.
8 9 10 |
# File 'lib/botz/definition_file.rb', line 8 def definition @definition end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
7 8 9 |
# File 'lib/botz/definition_file.rb', line 7 def path @path end |
Class Method Details
.open(filepath) ⇒ Object
11 12 13 14 15 |
# File 'lib/botz/definition_file.rb', line 11 def self.open(filepath) object = new(filepath) object.eval_definition object end |
Instance Method Details
#console ⇒ Object
27 28 29 30 |
# File 'lib/botz/definition_file.rb', line 27 def console require 'pry' Pry.start(Botz::Console.new(self)) end |
#eval_definition ⇒ Object
rubocop:disable Security/Eval
18 19 20 |
# File 'lib/botz/definition_file.rb', line 18 def eval_definition @definition = eval(File.open(path).read) end |
#shell ⇒ Object
rubocop:enable Security/Eval
23 24 25 |
# File 'lib/botz/definition_file.rb', line 23 def shell @shell ||= Botz::Shell.new(self) end |