lib/prospectus/state.rb in prospectus-0.5.2 vs lib/prospectus/state.rb in prospectus-0.5.4

- old
+ new

@@ -13,9 +13,21 @@ dsl = StateDSL.new(state, params) dsl.instance_eval(&block) dsl.load! state end + + def =~(other) + return super unless other.is_a? Prospectus::State + ov = other.value + return ov.include?(@value) if ov.is_a? Enumerable + return @value =~ ov if ov.is_a? Regexp + @value == ov + end + + def to_s + @value.to_s + end end ## # DSL for wrapping eval of states class StateDSL