Sha256: 2b96729cb8ce8698d057cd9a06a40265887df2965e1d0f3ab71bc0dc6cb9d98a

Contents?: true

Size: 463 Bytes

Versions: 3

Compression:

Stored size: 463 Bytes

Contents

# frozen_string_literal: true

module Yori
  module Schema
    # Any: supports any keyword as dsl.
    class Any < Yori::SchemaBase
      def respond_to_missing?(*)
        true
      end

      def method_missing(name, *args, &block)
        arg = args.first
        if arg || block_given?
          c = self.class.eval_input!(self.class, id, arg, &block)
          self[name.to_s] = c
          return self
        end
        super
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
yori-0.1.2 lib/yori/schema/any.rb
yori-0.1.1 lib/yori/schema/any.rb
yori-0.1.0 lib/yori/schema/any.rb