class Yarrow::Schema::Types::Interface

Attributes

implementation[RW]

Public Class Methods

all(*args) click to toggle source
# File lib/yarrow/schema/types.rb, line 124
def self.all(*args)
  interface_type = new(args)
  interface_type.implementation = :all
  interface_type
end
any(*args) click to toggle source
# File lib/yarrow/schema/types.rb, line 118
def self.any(*args)
  interface_type = new(args)
  interface_type.implementation = :any
  interface_type
end

Public Instance Methods

check(input) click to toggle source
# File lib/yarrow/schema/types.rb, line 134
def check(input)
  case implementation
  when :any then check_respond_to_any!(input, members)
  when :all then check_respond_to_all!(input, members)
  end

  input
end