Skip to Content Skip to Search

CardTemplate represents a card template of an Anki note type.

Methods
N
Included Modules

Class Public methods

new(note_type:, name: nil, args: nil)

Instantiates a new card template with name name for the note type note_type.

# File lib/anki_record/card_template/card_template.rb, line 12
def initialize(note_type:, name: nil, args: nil)
  raise ArgumentError unless (name && args.nil?) || (args && args["name"])

  @note_type = note_type
  if args
    setup_card_template_instance_variables_from_existing(args:)
  else
    setup_card_template_instance_variables(name:)
  end

  @note_type.add_card_template self
end