Class: DevelopWithPassion::Expander::ArrayDSL

Inherits:
Object
  • Object
show all
Defined in:
lib/developwithpassion_expander/array_dsl.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ ArrayDSL

Returns a new instance of ArrayDSL.



6
7
8
9
10
# File 'lib/developwithpassion_expander/array_dsl.rb', line 6

def initialize(name)
  @name = name
  initialize_arrays :mutators,:visitors
  initialize_false :writable,:readable
end

Instance Attribute Details

#mutatorsObject

Returns the value of attribute mutators.



4
5
6
# File 'lib/developwithpassion_expander/array_dsl.rb', line 4

def mutators
  @mutators
end

#nameObject

Returns the value of attribute name.



4
5
6
# File 'lib/developwithpassion_expander/array_dsl.rb', line 4

def name
  @name
end

#readableObject

Returns the value of attribute readable.



4
5
6
# File 'lib/developwithpassion_expander/array_dsl.rb', line 4

def readable
  @readable
end

#visitorsObject

Returns the value of attribute visitors.



4
5
6
# File 'lib/developwithpassion_expander/array_dsl.rb', line 4

def visitors
  @visitors
end

#writableObject

Returns the value of attribute writable.



4
5
6
# File 'lib/developwithpassion_expander/array_dsl.rb', line 4

def writable
  @writable
end

Instance Method Details

#mutator(value, &block) ⇒ Object



12
13
14
# File 'lib/developwithpassion_expander/array_dsl.rb', line 12

def mutator(value,&block)
  @mutators.push(ArrayMutator.new(value,block))
end

#process_using(name, visitor) ⇒ Object



16
17
18
# File 'lib/developwithpassion_expander/array_dsl.rb', line 16

def process_using(name,visitor)
  @visitors.push(ArrayVisitor.new(name,visitor))
end

#read_and_writeObject



20
21
22
23
# File 'lib/developwithpassion_expander/array_dsl.rb', line 20

def read_and_write
  writable
  readable
end