Class: Butterfly::YamlFile
- Inherits:
-
AdaptorBase
- Object
- AdaptorBase
- Butterfly::YamlFile
- Defined in:
- lib/butterfly/adaptors/yaml_file_adaptor.rb
Instance Method Summary collapse
- #get(req, resp) ⇒ Object
-
#initialize(o = {}) ⇒ YamlFile
constructor
A new instance of YamlFile.
Methods inherited from AdaptorBase
#delete, #handle_call, #post, #put
Constructor Details
Instance Method Details
#get(req, resp) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/butterfly/adaptors/yaml_file_adaptor.rb', line 10 def get(req, resp) if data.has_key?(req.params[0]) body = "", current_data = data req.params.each do |param| current_data = current_data[param] end current_data else resp.fail! "Not found" end end |