Sha256: 5e4e7348b16a7c56165fc15dd842b6baabb037d3263ff084bdee978ac8da6b32

Contents?: true

Size: 807 Bytes

Versions: 1

Compression:

Stored size: 807 Bytes

Contents

module RecordHelper
  RECORD_NAMES = %w{family kit library variation}
  PLURAL_RECORD_NAMES = %w{families kits libraries variations}

  def record_names
    RECORD_NAMES
  end

  def record_symbols
    @record_symbols ||= record_names.map(&:to_sym)
  end

  def record_classes
    @record_classes ||= record_names.map do |name|
      Typekit::Record.const_get(name.capitalize)
    end
  end

  def record_dictionary
    @record_dictionary ||= Hash[
      record_symbols.clone.zip(record_classes)
    ]
  end

  def plural_record_names
    PLURAL_RECORD_NAMES
  end

  def plural_record_symbols
    @plural_record_symbols ||= plural_record_names.map(&:to_sym)
  end

  def plural_record_dictionary
    @plural_record_dictionary ||= Hash[
      plural_record_symbols.clone.zip(record_classes)
    ]
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
typekit-client-0.0.6 spec/support/record_helper.rb