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.


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

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


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

def path
  @path
end

#siglumObject (readonly)

Returns the value of attribute siglum


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

def siglum
  @siglum
end

Instance Method Details

#loadSanctorale

Load the data file

Returns:


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

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


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

def load_with_parents
  SanctoraleFactory.load_with_parents(path)
end