Method: BxBuilderChain::Loader#load
- Defined in:
- lib/bx_builder_chain/loader.rb
#load {|String, Hash| ... } ⇒ Data
Load data from a file or URL
loader = BxBuilderChain::Loader.new("README.md")
# Load data using default processor for the file
loader.load
# Load data using a custom processor
loader.load do |raw_data, |
# your processing code goes here
# return data at the end here
end
78 79 80 81 82 83 |
# File 'lib/bx_builder_chain/loader.rb', line 78 def load(&block) return process_data(load_from_url, &block) if url? return load_from_directory(&block) if directory? process_data(load_from_path, &block) end |