Sha256: d513d186dc5887e34979bba31e83a3d591d2ca68feb885966d76b90c9d6302c0

Contents?: true

Size: 316 Bytes

Versions: 15

Compression:

Stored size: 316 Bytes

Contents

module EndState
  class Action
    attr_reader :object, :state

    def initialize(object, state)
      @object = object
      @state = state
    end

    def call
      object.state = object.class.store_states_as_strings ? state.to_s : state.to_sym
      true
    end

    def rollback
      call
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
end_state-1.1.2 lib/end_state/action.rb
end_state-1.1.1 lib/end_state/action.rb
end_state-1.1.0 lib/end_state/action.rb
end_state-1.0.2 lib/end_state/action.rb
end_state-1.0.1 lib/end_state/action.rb
end_state-1.0.0 lib/end_state/action.rb
end_state-0.12.0 lib/end_state/action.rb
end_state-0.11.0 lib/end_state/action.rb
end_state-0.10.1 lib/end_state/action.rb
end_state-0.10.0 lib/end_state/action.rb
end_state-0.9.0 lib/end_state/action.rb
end_state-0.4.0 lib/end_state/action.rb
end_state-0.3.2 lib/end_state/action.rb
end_state-0.3.1 lib/end_state/action.rb
end_state-0.3.0 lib/end_state/action.rb