Class: Cure::Configuration::CsvFileProxy
- Inherits:
-
Object
- Object
- Cure::Configuration::CsvFileProxy
- Defined in:
- lib/cure/config.rb
Instance Attribute Summary collapse
- #csv_handler ⇒ DefaultFileHandler readonly
- #valid ⇒ TrueClass, FalseClass readonly
Class Method Summary collapse
Instance Method Summary collapse
- #description ⇒ Object
- #initialize(csv_handler) ⇒ DefaultFileHandler constructor
- #with_file(&block) ⇒ Object
Constructor Details
#initialize(csv_handler) ⇒ DefaultFileHandler
98 99 100 |
# File 'lib/cure/config.rb', line 98 def initialize(csv_handler) @csv_handler = csv_handler end |
Instance Attribute Details
#csv_handler ⇒ DefaultFileHandler (readonly)
78 79 80 |
# File 'lib/cure/config.rb', line 78 def csv_handler @csv_handler end |
#valid ⇒ TrueClass, FalseClass (readonly)
76 77 78 |
# File 'lib/cure/config.rb', line 76 def valid @valid end |
Class Method Details
.load_file(type, obj, ref_name) ⇒ CsvFileProxy
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 |
# File 'lib/cure/config.rb', line 81 def self.load_file(type, obj, ref_name) handler = case type when :file FileHandler.new(obj, ref_name) when :file_contents FileContentsHandler.new(obj, ref_name) when :path, :pathname PathnameHandler.new(obj, ref_name) else raise "Invalid file type handler [#{type}]. Supported: [:file, :file_contents, :path, :pathname]" end new(handler) end |
Instance Method Details
#description ⇒ Object
102 103 104 |
# File 'lib/cure/config.rb', line 102 def description @csv_handler.description end |
#with_file(&block) ⇒ Object
106 107 108 |
# File 'lib/cure/config.rb', line 106 def with_file(&block) @csv_handler.with_file(&block) end |