Sha256: 946c581345a3d0adbe11c7723daa6c4411d87ac73a66b326f122e3e8f0cf0d21
Contents?: true
Size: 733 Bytes
Versions: 8
Compression:
Stored size: 733 Bytes
Contents
module Prospectus ## # Define a state object that supports modular checks class State attr_accessor :value def initialize(params = {}) @options = params end def self.from_block(params = {}, state = nil, &block) state ||= State.new(params) dsl = StateDSL.new(state, params) dsl.instance_eval(&block) dsl.load! state 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
8 entries across 8 versions & 1 rubygems