Sha256: b838bf52cf0175d3c7acdf4d7dcd4dff04c5302e406a9646c29469182d87bff7

Contents?: true

Size: 394 Bytes

Versions: 27

Compression:

Stored size: 394 Bytes

Contents

module CPEE

  class StateMachine
    def initialize(file,readonly,&state)
      @states = XML::Smart.open_unprotected(file)
      @state = state
      @readonly = readonly
    end

    def setable?(id,nval)
      cval = @state.call(id)
      @states.find("/states/setable/#{cval}[#{nval}]").length > 0
    end

    def readonly?(id)
      @readonly.include? @state.call(id)
    end
  end

end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
cpee-2.0.30 lib/cpee/statemachine.rb
cpee-2.0.28 lib/cpee/statemachine.rb
cpee-2.0.27 lib/cpee/statemachine.rb
cpee-2.0.26 lib/cpee/statemachine.rb
cpee-2.0.25 lib/cpee/statemachine.rb
cpee-2.0.24 lib/cpee/statemachine.rb
cpee-2.0.23 lib/cpee/statemachine.rb
cpee-2.0.22 lib/cpee/statemachine.rb
cpee-2.0.21 lib/cpee/statemachine.rb
cpee-2.0.20 lib/cpee/statemachine.rb
cpee-2.0.19 lib/cpee/statemachine.rb
cpee-2.0.18 lib/cpee/statemachine.rb
cpee-2.0.17 lib/cpee/statemachine.rb
cpee-2.0.16 lib/cpee/statemachine.rb
cpee-2.0.15 lib/cpee/statemachine.rb
cpee-2.0.14 lib/cpee/statemachine.rb
cpee-2.0.13 lib/cpee/statemachine.rb
cpee-2.0.11 lib/cpee/statemachine.rb
cpee-2.0.9 lib/cpee/statemachine.rb
cpee-2.0.8 lib/cpee/statemachine.rb