Class: DevelopWithPassion::Arrays::Dsl
- Defined in:
- lib/developwithpassion_arrays/dsl.rb
Instance Attribute Summary collapse
-
#criteria ⇒ Object
Returns the value of attribute criteria.
-
#mutators ⇒ Object
Returns the value of attribute mutators.
-
#name ⇒ Object
Returns the value of attribute name.
-
#readable ⇒ Object
Returns the value of attribute readable.
-
#visitors ⇒ Object
Returns the value of attribute visitors.
-
#writable ⇒ Object
Returns the value of attribute writable.
Instance Method Summary collapse
-
#initialize(name) ⇒ Dsl
constructor
A new instance of Dsl.
- #mutator(*names, &block) ⇒ Object
- #new_item_must(criteria, fail_option) ⇒ Object
- #process_using(name, visitor) ⇒ Object
- #read_and_write ⇒ Object
Constructor Details
#initialize(name) ⇒ Dsl
Returns a new instance of Dsl.
6 7 8 9 10 |
# File 'lib/developwithpassion_arrays/dsl.rb', line 6 def initialize(name) @name = name initialize_arrays :mutators,:visitors,:criteria initialize_false :writable,:readable end |
Instance Attribute Details
#criteria ⇒ Object
Returns the value of attribute criteria.
4 5 6 |
# File 'lib/developwithpassion_arrays/dsl.rb', line 4 def criteria @criteria end |
#mutators ⇒ Object
Returns the value of attribute mutators.
4 5 6 |
# File 'lib/developwithpassion_arrays/dsl.rb', line 4 def mutators @mutators end |
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/developwithpassion_arrays/dsl.rb', line 4 def name @name end |
#readable ⇒ Object
Returns the value of attribute readable.
4 5 6 |
# File 'lib/developwithpassion_arrays/dsl.rb', line 4 def readable @readable end |
#visitors ⇒ Object
Returns the value of attribute visitors.
4 5 6 |
# File 'lib/developwithpassion_arrays/dsl.rb', line 4 def visitors @visitors end |
#writable ⇒ Object
Returns the value of attribute writable.
4 5 6 |
# File 'lib/developwithpassion_arrays/dsl.rb', line 4 def writable @writable end |
Instance Method Details
#mutator(*names, &block) ⇒ Object
12 13 14 |
# File 'lib/developwithpassion_arrays/dsl.rb', line 12 def mutator(*names,&block) names.each{|name| @mutators.push(MutatorDetail.new(name,block))} end |
#new_item_must(criteria, fail_option) ⇒ Object
16 17 18 |
# File 'lib/developwithpassion_arrays/dsl.rb', line 16 def new_item_must(criteria,fail_option) @criteria.push(AddCriterion.new(criteria,fail_option)) end |
#process_using(name, visitor) ⇒ Object
20 21 22 |
# File 'lib/developwithpassion_arrays/dsl.rb', line 20 def process_using(name,visitor) @visitors.push(VisitorDetail.new(name,visitor)) end |
#read_and_write ⇒ Object
24 25 26 27 |
# File 'lib/developwithpassion_arrays/dsl.rb', line 24 def read_and_write writable readable end |