Class: Anki::CardFace

Inherits:
Object
  • Object
show all
Defined in:
lib/ankirb/anki/card.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(content) ⇒ CardFace

Returns a new instance of CardFace.



71
72
73
74
# File 'lib/ankirb/anki/card.rb', line 71

def initialize content
  @content = content
  @media = []
end

Instance Attribute Details

#contentObject

Returns the value of attribute content.



69
70
71
# File 'lib/ankirb/anki/card.rb', line 69

def content
  @content
end

#mediaObject

Returns the value of attribute media.



69
70
71
# File 'lib/ankirb/anki/card.rb', line 69

def media
  @media
end

Instance Method Details

#<<(thing) ⇒ Object



76
77
78
79
80
81
82
83
84
# File 'lib/ankirb/anki/card.rb', line 76

def << thing
  return unless thing and not thing.empty?

  if File.exists?(thing)
    @media << thing
  else
    @content << thing
  end
end

#to_sObject



86
87
88
# File 'lib/ankirb/anki/card.rb', line 86

def to_s
  @content
end