Sha256: 6d1b8d2e281292da05654cd3f039d6bf95e7380f447a5f0e7059aa3ee19d66c5

Contents?: true

Size: 675 Bytes

Versions: 3

Compression:

Stored size: 675 Bytes

Contents

module Theotokos
  module Model

    class TextOperator
    
      def initialize(opt = {})
        if block_given?
          yield self
        else
          _load_properties opt
        end
      end
      
      attr_accessor :contains, :not_contains, :equals, :regex
      
      def to_hash
        Hash.new({
          :contains => @contains, :not_contains => @not_contains,
          :equals => @equals, :regex => @regex
        })
      end
      
      private
      def _load_properties(opt)
        @contains = opt[:contains]
        @not_contains = opt[:not_contains]
        @equals = opt[:equals]
        @regex = opt[:regex]
      end
    
    end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
theotokos-0.1.3 lib/model/text_operator.rb
theotokos-0.1.2 lib/model/text_operator.rb
theotokos-0.1.1 lib/model/text_operator.rb