Restfulie

码农软件 · 软件分类 · WEB服务/SOAP/SOA · 2019-04-09 21:13:29

软件介绍

RESTfulie 是一个创建超媒体感知服务与客户端的Gem。在开发超媒体感知的服务和客户端的时候使用RESTfulie将非常容易。

下面描述了定义一个订单的例子,这一订单将经过一系列定义好的转变,比如从未结算到结算等等。它允许将各种各样的转变映射到对应的动作...

class Order < ActiveRecord::Base 
state :unpaid, :allow => [:latest, :pay, :cancel]
state :cancelled, :allow => :latest

transition :latest, {:action => :show}
transition :cancel, {:action => :destroy}, :cancelled
transition :pay, {}, :preparing
end

它将会生成诸如这样的一个基于atom的嵌入超媒体的资源表示:

<order> 
<product>basic rails course</product>
<product>RESTful training</product>
<atom:link xmlns:atom="http://www.w3.org/2005/Atom"
target="_blank" rel="nofollow" href="http://www.caelum.com.br/orders/1" rel="latest" />
<atom:link xmlns:atom="http://www.w3.org/2005/Atom"
target="_blank" rel="nofollow" href="http://www.caelum.com.br/orders/1/pay" rel="pay" />
<atom:link xmlns:atom="http://www.w3.org/2005/Atom"
target="_blank" rel="nofollow" href="http://www.caelum.com.br/orders/1" rel="cancel" />

</order>

并且支持客户端调用通过消费这一资源表示而动态创建的方法:

order = Order.from_web 'http://caelum.com.br/orders/1' 
order.pay(payment)

 

本文地址:https://codercto.com/soft/d/3233.html

必然

必然

[美] 凯文·凯利 / 周峰、董理、金阳 / 译言·东西文库/电子工业出版社 / 2016-1 / 58.00元

凯文·凯利对于经济和社会发展的趋势有着深刻的见解。20年前,他的《失控》一书,便已预见了当下几乎所有的互联网经济热点概念,如:物联网、云计算、虚拟现实、网络社区、大众智慧、迭代等。此次,凯文·凯利在新书《必然》中,提到了未来20年的12种必然趋势。一起来看看 《必然》 这本书的介绍吧!

图片转BASE64编码
图片转BASE64编码

在线图片转Base64编码工具

RGB HSV 转换
RGB HSV 转换

RGB HSV 互转工具

HEX HSV 转换工具
HEX HSV 转换工具

HEX HSV 互换工具