Class: RedShift::Transition

Inherits:
XArray show all
Extended by:
AccessibleIndex
Defined in:
lib/redshift/component.rb

Overview

put this in meta?

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from AccessibleIndex

index_accessor, index_reader, index_writer

Methods inherited from XArray

#inspect

Methods inherited from Array

#diff, #filter

Constructor Details

#initialize(spec) ⇒ Transition

Returns a new instance of Transition.



70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/redshift/component.rb', line 70

def initialize spec
  if spec.kind_of? Hash
    spec = spec.dup
    def spec.method_missing(m, *); self[m]; end
  end
  
  @name = spec.name || "transition_#{object_id}".intern
  self.guard = spec.guards; self.sync = spec.syncs
  self.action = spec.actions; self.reset = spec.resets
  self.event = spec.events; self.post = spec.posts
  self.connect = spec.connects
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



61
62
63
# File 'lib/redshift/component.rb', line 61

def name
  @name
end