example: http://halform.herokuapp.com/
| require_relative 'deferrable' | |
| require_relative 'slime' | |
| class WidgetsController | |
| include ControllerSlime | |
| def create | |
| creator = WidgetCreator.new(attributes: params[:widget]) | |
| creator.done do |widget| |
| require 'rspec' | |
| class DevOps | |
| attr_reader :monitor | |
| def initialize(arguments) | |
| @monitor = arguments.fetch(:monitor) { Monitor.new } | |
| end | |
| def check |
| { | |
| "_links": { | |
| "self": { "href": "/foo" }, | |
| }, | |
| "_controls": { | |
| "attack": { | |
| "target": "/attacks", | |
| "method": "POST", | |
| "headers": { | |
| "Content-Type": "application/json" |
| { | |
| "_links": { | |
| "self": { | |
| "href": "/product/987" | |
| }, | |
| "manufacturer": { | |
| "href": "/manufacturer/328764", | |
| "title": "Manufacturer Inc." | |
| } | |
| }, |
| require 'hactor' | |
| class HomeActor | |
| include Hactor::Actor | |
| def on_200(response) | |
| response.follow 'ht:users', actor: UserListActor.new | |
| end | |
| end |
Real world test of whether using CURIE notation in URLs actually reduces filesize after gzip compression.
Example taken from:
Results:
Before gzip compression:
| { | |
| "_links":{ | |
| "self":{ | |
| "href":"/users" | |
| } | |
| }, | |
| "_forms":{ | |
| "create-user":{ | |
| "title":"Create a new widget", | |
| "description":"Enter your widget info and submit to create a new widget", |
I believe that if we are honest with ourselves, that the most fascinating problem in the world is “who am I?” What do you mean? What do you feel when you say the word “I, myself”? I don’t think there can be anymore fascinating preoccupation than that because it is so mysterious. It is so elusive. Because what you are in your inmost being escapes your examination in rather the same way you cant look into your own eyes without a mirror, you can’t bite your own teeth, you can’t taste your own tongue and you can’t touch the end of one finger with the same finger. That is why there is always an element of profound mystery in the problem of who we are."
-- Alan Watts
| class UsersController < ApplicationController | |
| def create | |
| CreateUserService.new.call( | |
| params[:user], | |
| on_success: public_method(:create_successful), | |
| on_failure: public_method(:create_failure) | |
| ) | |
| end | |
| def create_successful(user) |