spyke:以类似于ActiveRecord的方式与REST服务进行交互-源码

上传者: 42115003 | 上传时间: 2021-02-02 03:35:38 | 文件大小: 33KB | 文件类型: ZIP
斯派克 以类似于ActiveRecord的方式与远程REST服务进行交互。 斯派克基本上撕掉需要灵感 :smiling_face_with_halo: 从那里,我们不幸抛弃了它,因为它给我们带来了一些性能问题,并且维护工作似乎已经过时了。 因此,我们制作了Spyke,它为我们的项目添加了一些修复/功能: 快速处理甚至大量的JSON 适当支持范围 能够为关联定义自定义URI 类似于ActiveRecord的日志输出 API端验证的处理 可查询的名称! :) 组态 将此行添加到您的应用程序的Gemfile中: gem 'spyke' gem 'multi_json' # or whatever is needed to parse responses Spyke使用Faraday来处理请求,并期望其将响应主体解析为以下格式的哈希值: { data : { id : 1 , name : 'Bob' } , metadata : { } , errors : { } } 因此,例如对于返回如下JSON的API: { " result " : { " id " : 1 ,

文件下载

资源详情

[{"title":"( 46 个子文件 33KB ) spyke:以类似于ActiveRecord的方式与REST服务进行交互-源码","children":[{"title":"spyke-master","children":[{"title":".travis.yml <span style='color:#111;'> 57B </span>","children":null,"spread":false},{"title":"Rakefile <span style='color:#111;'> 154B </span>","children":null,"spread":false},{"title":"test","children":[{"title":"config_test.rb <span style='color:#111;'> 343B </span>","children":null,"spread":false},{"title":"test_helper.rb <span style='color:#111;'> 459B </span>","children":null,"spread":false},{"title":"associations_test.rb <span style='color:#111;'> 17.01KB </span>","children":null,"spread":false},{"title":"callbacks_test.rb <span style='color:#111;'> 545B </span>","children":null,"spread":false},{"title":"orm_test.rb <span style='color:#111;'> 7.49KB </span>","children":null,"spread":false},{"title":"support","children":[{"title":"fixtures.rb <span style='color:#111;'> 3.61KB </span>","children":null,"spread":false},{"title":"webmock.rb <span style='color:#111;'> 404B </span>","children":null,"spread":false}],"spread":true},{"title":"scopes_test.rb <span style='color:#111;'> 4.29KB </span>","children":null,"spread":false},{"title":"path_test.rb <span style='color:#111;'> 1.78KB </span>","children":null,"spread":false},{"title":"custom_request_test.rb <span style='color:#111;'> 2.80KB </span>","children":null,"spread":false},{"title":"fallbacks_test.rb <span style='color:#111;'> 1.08KB </span>","children":null,"spread":false},{"title":"attributes_test.rb <span style='color:#111;'> 4.93KB </span>","children":null,"spread":false},{"title":"activemodel_dirty_test.rb <span style='color:#111;'> 349B </span>","children":null,"spread":false}],"spread":false},{"title":"Gemfile <span style='color:#111;'> 90B </span>","children":null,"spread":false},{"title":".gitignore <span style='color:#111;'> 185B </span>","children":null,"spread":false},{"title":"spyke.gemspec <span style='color:#111;'> 1.52KB </span>","children":null,"spread":false},{"title":"lib","children":[{"title":"spyke.rb <span style='color:#111;'> 173B </span>","children":null,"spread":false},{"title":"spyke","children":[{"title":"exceptions.rb <span style='color:#111;'> 108B </span>","children":null,"spread":false},{"title":"config.rb <span style='color:#111;'> 236B </span>","children":null,"spread":false},{"title":"base.rb <span style='color:#111;'> 364B </span>","children":null,"spread":false},{"title":"orm.rb <span style='color:#111;'> 2.03KB </span>","children":null,"spread":false},{"title":"associations","children":[{"title":"belongs_to.rb <span style='color:#111;'> 576B </span>","children":null,"spread":false},{"title":"has_one.rb <span style='color:#111;'> 276B </span>","children":null,"spread":false},{"title":"has_many.rb <span style='color:#111;'> 1.68KB </span>","children":null,"spread":false},{"title":"builder.rb <span style='color:#111;'> 1.20KB </span>","children":null,"spread":false},{"title":"association.rb <span style='color:#111;'> 1.26KB </span>","children":null,"spread":false}],"spread":true},{"title":"result.rb <span style='color:#111;'> 363B </span>","children":null,"spread":false},{"title":"scope_registry.rb <span style='color:#111;'> 388B </span>","children":null,"spread":false},{"title":"attribute_assignment.rb <span style='color:#111;'> 3.46KB </span>","children":null,"spread":false},{"title":"rfc_converter.rb <span style='color:#111;'> 609B </span>","children":null,"spread":false},{"title":"http.rb <span style='color:#111;'> 3.22KB </span>","children":null,"spread":false},{"title":"version.rb <span style='color:#111;'> 37B </span>","children":null,"spread":false},{"title":"instrumentation.rb <span style='color:#111;'> 256B </span>","children":null,"spread":false},{"title":"scoping.rb <span style='color:#111;'> 699B </span>","children":null,"spread":false},{"title":"collection.rb <span style='color:#111;'> 180B </span>","children":null,"spread":false},{"title":"path.rb <span style='color:#111;'> 1.47KB </span>","children":null,"spread":false},{"title":"attributes.rb <span style='color:#111;'> 596B </span>","children":null,"spread":false},{"title":"instrumentation","children":[{"title":"controller_runtime.rb <span style='color:#111;'> 1.17KB </span>","children":null,"spread":false},{"title":"log_subscriber.rb <span style='color:#111;'> 740B </span>","children":null,"spread":false}],"spread":false},{"title":"associations.rb <span style='color:#111;'> 1.90KB </span>","children":null,"spread":false},{"title":"relation.rb <span style='color:#111;'> 1.92KB </span>","children":null,"spread":false},{"title":"normalized_validation_error.rb <span style='color:#111;'> 457B </span>","children":null,"spread":false}],"spread":false}],"spread":true},{"title":"README.md <span style='color:#111;'> 7.13KB </span>","children":null,"spread":false},{"title":"LICENSE.txt <span style='color:#111;'> 1.04KB </span>","children":null,"spread":false}],"spread":true}],"spread":true}]

评论信息

免责申明

【只为小站】的资源来自网友分享,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,【只为小站】 无法对用户传输的作品、信息、内容的权属或合法性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论 【只为小站】 经营者是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。
本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二条之规定,若资源存在侵权或相关问题请联系本站客服人员,zhiweidada#qq.com,请把#换成@,本站将给予最大的支持与配合,做到及时反馈和处理。关于更多版权及免责申明参见 版权及免责申明