Class: Botz::DefinitionFile
- Inherits:
-
Object
- Object
- Botz::DefinitionFile
- Defined in:
- lib/botz/definition_file.rb
Overview
botz interface binding
Constant Summary collapse
- CSV =
lambda do |result| ::CSV.generate do |csv| csv << result.definition.attributes_to_array end end
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
17 18 19 20 21 |
# File 'lib/botz/definition_file.rb', line 17 def self.open(filepath) object = new(filepath) object.eval_definition object end |
Instance Method Details
#console ⇒ Object
33 34 35 36 |
# File 'lib/botz/definition_file.rb', line 33 def console require 'pry' Pry.start(Botz::Console.new(self)) end |
#eval_definition ⇒ Object
rubocop:disable Security/Eval
24 25 26 |
# File 'lib/botz/definition_file.rb', line 24 def eval_definition @definition = eval(File.open(path).read) end |