Sha256: de6dc9a91364b2a29781f003575d3d49480cf914a1b73c0fdad48bf2c40ed4f6

Contents?: true

Size: 463 Bytes

Versions: 10

Compression:

Stored size: 463 Bytes

Contents

module Rasti
  class Form
    module Types
      class Regexp

        include Formatable

        def self.[](format)
          new format
        end

        def to_s
          "#{self.class}[#{format.inspect}]"
        end
        alias_method :inspect, :to_s

        private
        
        attr_reader :format

        def initialize(format)
          @format = format.is_a?(String) ? ::Regexp.new(format) : format
        end

      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
rasti-form-2.2.0 lib/rasti/form/types/regexp.rb
rasti-form-2.1.0 lib/rasti/form/types/regexp.rb
rasti-form-2.0.0 lib/rasti/form/types/regexp.rb
rasti-form-1.1.1 lib/rasti/form/types/regexp.rb
rasti-form-1.1.0 lib/rasti/form/types/regexp.rb
rasti-form-1.0.3 lib/rasti/form/types/regexp.rb
rasti-form-1.0.2 lib/rasti/form/types/regexp.rb
rasti-form-1.0.1 lib/rasti/form/types/regexp.rb
rasti-form-1.0.0 lib/rasti/form/types/regexp.rb
rasti-form-0.1.0 lib/rasti/form/types/regexp.rb