Class: Safer::IVarFactory::Dsl
- Inherits:
-
Object
- Object
- Safer::IVarFactory::Dsl
- Defined in:
- lib/safer/ivarfactory/dsl.rb
Overview
Instance Method Summary collapse
-
#accessor(*args) ⇒ Object
Export accessors for Safer::IVarFactory instance variables in the class attached to this DSL object.
-
#initialize(factory, klass) ⇒ Dsl
constructor
Initialize a DSL object.
-
#ivar(*args) ⇒ Object
Define Safer::IVarFactory instance variables for the class attached to this DSL object.
-
#reader(*args) ⇒ Object
Export readers for Safer::IVarFactory instance variables in the class attached to this DSL object.
-
#writer(*args) ⇒ Object
Export writers for Safer::IVarFactory instance variables in the class attached to this DSL object.
Constructor Details
#initialize(factory, klass) ⇒ Dsl
Initialize a DSL object.
factory
-
IVarFactory to use for creating instance variables.
klass
-
+klass argument to Safer::IVarFactory#run; create instance variables in this class.
16 17 18 19 20 |
# File 'lib/safer/ivarfactory/dsl.rb', line 16 def initialize(factory, klass) @factory = factory @klass = klass @symbol_prefix = factory.class_symbol_prefix(klass) end |
Instance Method Details
#accessor(*args) ⇒ Object
Export accessors for Safer::IVarFactory instance variables in the class attached to this DSL object. See Safer::IVarFactory#export_reader
46 47 48 |
# File 'lib/safer/ivarfactory/dsl.rb', line 46 def accessor(*args) @factory._export_accessor_internal(@klass, @symbol_prefix, args) end |
#ivar(*args) ⇒ Object
Define Safer::IVarFactory instance variables for the class attached to this DSL object. See Safer::IVarFactory#instance_variable
25 26 27 |
# File 'lib/safer/ivarfactory/dsl.rb', line 25 def ivar(*args) @factory._instance_variable_internal(@klass, @symbol_prefix, args) end |
#reader(*args) ⇒ Object
Export readers for Safer::IVarFactory instance variables in the class attached to this DSL object. See Safer::IVarFactory#export_reader
32 33 34 |
# File 'lib/safer/ivarfactory/dsl.rb', line 32 def reader(*args) @factory._export_reader_internal(@klass, @symbol_prefix, args) end |
#writer(*args) ⇒ Object
Export writers for Safer::IVarFactory instance variables in the class attached to this DSL object. See Safer::IVarFactory#export_reader
39 40 41 |
# File 'lib/safer/ivarfactory/dsl.rb', line 39 def writer(*args) @factory._export_writer_internal(@klass, @symbol_prefix, args) end |