Class: SelfControl::Builder

Inherits:
Object
  • Object
show all
Defined in:
lib/self-control/builder.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(klass, state_column = false, &block) ⇒ Builder

Returns a new instance of Builder.



5
6
7
8
9
10
11
# File 'lib/self-control/builder.rb', line 5

def initialize(klass, state_column=false, &block)
  @state_column = (state_column ? state_column.to_sym : false)
  @klass = klass
  @actions = {}
  @flows = {}
  instance_eval(&block)
end

Instance Attribute Details

#actions ⇒ Object

Returns the value of attribute actions.



3
4
5
# File 'lib/self-control/builder.rb', line 3

def actions
  @actions
end

#flows ⇒ Object

Returns the value of attribute flows.



3
4
5
# File 'lib/self-control/builder.rb', line 3

def flows
  @flows
end

#klass ⇒ Object

Returns the value of attribute klass.



3
4
5
# File 'lib/self-control/builder.rb', line 3

def klass
  @klass
end

#state_column ⇒ Object

Returns the value of attribute state_column.



3
4
5
# File 'lib/self-control/builder.rb', line 3

def state_column
  @state_column
end