Sha256: 4d0de56d7ed9dbde875249e7d4505853dac9640cd12a4983d04af7f1c4a852ed

Contents?: true

Size: 532 Bytes

Versions: 4

Compression:

Stored size: 532 Bytes

Contents

module Prospectus
  ##
  # Define a state object that supports modular checks
  class State
    attr_accessor :value

    def initialize(params = {})
      @options = params
    end
  end

  ##
  # DSL for wrapping eval of states
  class StateDSL
    def initialize(state, params)
      @state = state
      @options = params
    end

    def method_missing(method, *args, &block)
      return super if @module
      @module = Prospectus.modules.find(method)
      return super unless @module
      extend @module
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
prospectus-0.0.5 lib/prospectus/state.rb
prospectus-0.0.4 lib/prospectus/state.rb
prospectus-0.0.3 lib/prospectus/state.rb
prospectus-0.0.2 lib/prospectus/state.rb