Sha256: 34a68711731e28a32ac525956ced20bdb819c5df822fdc739df412b9d9d66620

Contents?: true

Size: 483 Bytes

Versions: 6

Compression:

Stored size: 483 Bytes

Contents

require "jsduck/class"

# A helper for easy creation of classes in tests
#
# Allows simplified members hashes to be used.
module Helper
  class ClassFactory
    def self.create(cfg)
      cfg[:members].each do |m|
        m[:tagname] = :property unless m[:tagname]
        m[:owner] = cfg[:name]
        m[:meta] = {} unless m[:meta]
        m[:meta][:static] = true if m[:static]
        m[:id] = JsDuck::Class.member_id(m)
      end

      JsDuck::Class.new(cfg)
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
jsduck-4.3.2 spec/class_factory.rb
jsduck-4.3.1 spec/class_factory.rb
jsduck-4.3.0 spec/class_factory.rb
jsduck-4.2.1 spec/class_factory.rb
jsduck-4.2.0 spec/class_factory.rb
jsduck-4.1.1 spec/class_factory.rb