class States::Dsl::State

Attributes

name[R]

Public Class Methods

new(name, context, options={}) click to toggle source
Calls superclass method
# File lib/states/dsl/state.rb, line 6
def initialize(name, context, options={})
  super(options)
  @name = context.naming << name
  self.context = context
end

Public Instance Methods

serializable_hash() click to toggle source
Calls superclass method
# File lib/states/dsl/state.rb, line 12
def serializable_hash
  json = super
  json["Type"] ||= "Pass"
  if json["Next"].nil? && !%w(Choice Fail).include?(json["Type"])
    json["End"] = true
  end
  json
end