Sha256: 0d7133c4b811cb9e0d49c43f72e3ed0af0cce085fc2bf498f5c891dc9e211e4e

Contents?: true

Size: 828 Bytes

Versions: 12

Compression:

Stored size: 828 Bytes

Contents

require File.join(File.dirname(__FILE__), '..', '..', 'lib', 'aasm')

class Conversation
  include AASM

  aasm_initial_state :needs_attention

  aasm_state :needs_attention
  aasm_state :read
  aasm_state :closed
  aasm_state :awaiting_response
  aasm_state :junk

  aasm_event :new_message do
  end

  aasm_event :view do
    transitions :to => :read, :from => [:needs_attention]
  end

  aasm_event :reply do
  end

  aasm_event :close do
    transitions :to => :closed, :from => [:read, :awaiting_response]
  end

  aasm_event :junk do
    transitions :to => :junk, :from => [:read]
  end

  aasm_event :unjunk do
  end

  def initialize(persister)
    @persister = persister
  end


  private
  def aasm_read_state
    @persister.read_state
  end

  def aasm_write_state(state)
    @persister.write_state(state)
  end

end

Version data entries

12 entries across 12 versions & 5 rubygems

Version Path
runcoderun-aasm-2.0.2.2 spec/functional/conversation.rb
aasm-2.3.1 spec/functional/conversation.rb
aasm-2.3.0 spec/functional/conversation.rb
aasm-2.2.1 spec/functional/conversation.rb
aasm-2.2.0 spec/functional/conversation.rb
mylescarrick-aasm-2.1.5 spec/functional/conversation.rb
fcoury-aasm-2.1.5 spec/functional/conversation.rb
r38y-aasm-2.1.5 spec/functional/conversation.rb
aasm-2.1.5 spec/functional/conversation.rb
aasm-2.1.4 spec/functional/conversation.rb
fcoury-aasm-2.1.3 spec/functional/conversation.rb
aasm-2.1.3 spec/functional/conversation.rb