Class: CalendariumRomanum::Data::SanctoraleFile

Inherits:
Object
  • Object
show all
Defined in:
lib/calendarium-romanum/data.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(base_name) ⇒ SanctoraleFile

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

This class is not intended to be initialized by client code - it’s sole purpose is to provide functionality for easy loading of the bundled sanctorale data files.



14
15
16
17
# File 'lib/calendarium-romanum/data.rb', line 14

def initialize(base_name)
  @siglum = base_name.sub(/\.txt$/, '')
  @path = File.expand_path('../../data/' + base_name, File.dirname(__FILE__))
end

Instance Attribute Details

#pathObject (readonly)

Returns the value of attribute path.



19
20
21
# File 'lib/calendarium-romanum/data.rb', line 19

def path
  @path
end

#siglumObject (readonly)

Returns the value of attribute siglum.



19
20
21
# File 'lib/calendarium-romanum/data.rb', line 19

def siglum
  @siglum
end

Instance Method Details

#loadSanctorale

Load the data file

Returns:



24
25
26
# File 'lib/calendarium-romanum/data.rb', line 24

def load
  SanctoraleLoader.new.load_from_file(path)
end

#load_with_parentsSanctorale

Load the data file and all it’s parents

Returns:

Since:

  • 0.7.0



32
33
34
# File 'lib/calendarium-romanum/data.rb', line 32

def load_with_parents
  SanctoraleFactory.load_with_parents(path)
end