module Eapi::Methods::Types::ClassMethods

Public Class Methods

included(klass) click to toggle source
# File lib/eapi/methods/types.rb, line 60
def self.included(klass)
  klass.send :include, IsAnOtherTypeMethods
end

Public Instance Methods

is(*types) click to toggle source
# File lib/eapi/methods/types.rb, line 74
def is(*types)
  ts = types.map { |t| Types.to_type_sym t }

  @i_am_a ||= []
  @i_am_a.concat ts
end
is?(type) click to toggle source
# File lib/eapi/methods/types.rb, line 64
def is?(type)
  return true if Checker._is_type_module?(self, type)

  type_sym = Types.to_type_sym type
  return true if Checker._is_type_module_sym?(self, type_sym)

  return false unless @i_am_a.present?
  !!@i_am_a.include?(type_sym) # force it to be a bool
end