Class: SimplyStated::State

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, klass) ⇒ State

Returns a new instance of State.



63
# File 'lib/simply_stated.rb', line 63

def initialize(name, klass) self.klass, self.name = klass, name end

Instance Attribute Details

#klassObject

Returns the value of attribute klass.



62
63
64
# File 'lib/simply_stated.rb', line 62

def klass
  @klass
end

#nameObject

Returns the value of attribute name.



62
63
64
# File 'lib/simply_stated.rb', line 62

def name
  @name
end

Instance Method Details

#transitions(&blk) ⇒ Object



64
# File 'lib/simply_stated.rb', line 64

def transitions(&blk) klass.transition_from(name, &blk) end

#validations(*args, &blk) ⇒ Object



65
# File 'lib/simply_stated.rb', line 65

def validations(*args, &blk) klass.state_validations(name, *args, &blk) end