Class: Blur::Extension
- Inherits:
-
Object
- Object
- Blur::Extension
- Includes:
- Evaluable, Script::DSL, Logging
- Defined in:
- library/blur/extension.rb
Overview
Extension
provides a sort of modules for scripts, for common functionality.
Think of it as a kind of scripts for scripts.
Instance Attribute Summary collapse
-
#__client ⇒ Network::Client
Can be used inside the script to act with the client itself.
-
#__path ⇒ Object
The path in which the script remains.
Instance Method Summary collapse
-
#Extension(name, &block) ⇒ Object
Purely for DSL purposes.
-
#initialize(path) ⇒ Extension
constructor
Instantiates a new extension context and evaluates the
path
extension file.
Methods included from Script::DSL
#Author, #Description, #Version, #author, #description, included, #name, #version
Methods included from Evaluable
Constructor Details
#initialize(path) ⇒ Extension
Instantiates a new extension context and evaluates the path
extension file.
20 21 22 23 24 25 26 |
# File 'library/blur/extension.rb', line 20 def initialize path @__path = path if evaluate_source_file path log.info "Loaded extension #{@__path}" end end |
Instance Attribute Details
#__client ⇒ Network::Client
Can be used inside the script to act with the client itself.
16 17 18 |
# File 'library/blur/extension.rb', line 16 def __client @__client end |
#__path ⇒ Object
Returns the path in which the script remains.
13 14 15 |
# File 'library/blur/extension.rb', line 13 def __path @__path end |
Instance Method Details
#Extension(name, &block) ⇒ Object
Purely for DSL purposes.
34 35 36 37 38 39 40 |
# File 'library/blur/extension.rb', line 34 def Extension name, &block @__name = name instance_eval &block true end |