Class: Yap::Addon::RcFile
Instance Attribute Summary collapse
-
#file ⇒ Object
readonly
Returns the value of attribute file.
Instance Method Summary collapse
- #addon_name ⇒ Object
-
#initialize(file) ⇒ RcFile
constructor
A new instance of RcFile.
- #initialize_world(world) ⇒ Object
Methods inherited from Base
addon_name, export_as, #export_as, load_addon, logger, #logger, #yap_enabled?
Constructor Details
#initialize(file) ⇒ RcFile
Returns a new instance of RcFile.
6 7 8 9 |
# File 'lib/yap/addon/rc_file.rb', line 6 def initialize(file) super(enabled: true) @file = File.(file) end |
Instance Attribute Details
#file ⇒ Object (readonly)
Returns the value of attribute file.
4 5 6 |
# File 'lib/yap/addon/rc_file.rb', line 4 def file @file end |
Instance Method Details
#addon_name ⇒ Object
11 12 13 |
# File 'lib/yap/addon/rc_file.rb', line 11 def addon_name @file end |
#initialize_world(world) ⇒ Object
15 16 17 18 |
# File 'lib/yap/addon/rc_file.rb', line 15 def initialize_world(world) Treefell['shell'].puts "initializing rcfile: #{file}" world.instance_eval File.read(@file), @file end |