class Mexico::FileSystem::Section
This class provides a corpus representation that is backed up by the filesystem. A central Corpus definition file in the top-level folder contains an XML representation of the corpus structure, and all actual resources are found as files on a file system reachable from the top-level folder.
Constants
- DATA_MODEL
- LAYER_TYPES
- LIFECYCLE
- MEDIA_CONTEXT
- SECTION_KEYS
- VOCABULARIES
Public Class Methods
new(key='NOTGIVEN')
click to toggle source
# File lib/mexico/file_system/section.rb, line 43 def initialize(key='NOTGIVEN') @key = key @properties = [] @property_maps = [] end
Public Instance Methods
[](p_key)
click to toggle source
# File lib/mexico/file_system/section.rb, line 56 def [](p_key) # compare_list(p_key) if properties.any?{|x| x.key.to_sym == p_key.to_sym} return properties.find{|x| x.key.to_sym == p_key.to_sym} end if property_maps.any?{|x| x.key.to_sym == p_key.to_sym} return property_maps.find{|x| x.key.to_sym == p_key.to_sym} end return nil end
has_key?(p_key)
click to toggle source
# File lib/mexico/file_system/section.rb, line 49 def has_key?(p_key) # compare_list(p_key) return true if properties.any?{|x| x.key.to_sym == p_key.to_sym} return true if property_maps.any?{|x| x.key.to_sym == p_key.to_sym} false end