Module: RbsActivemodel::ActiveModel

Defined in:
lib/rbs_activemodel/active_model.rb

Defined Under Namespace

Classes: Generator

Class Method Summary collapse

Class Method Details

.allObject



11
12
13
14
15
16
17
# File 'lib/rbs_activemodel/active_model.rb', line 11

def self.all
  ObjectSpace.each_object.select do |obj|
    obj.is_a?(Class) && obj.ancestors.include?(::ActiveModel::Validations)
  rescue StandardError
    nil
  end
end

.class_to_rbs(klass) ⇒ Object



19
20
21
# File 'lib/rbs_activemodel/active_model.rb', line 19

def self.class_to_rbs(klass)
  Generator.new(klass).generate
end