Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rabx-message

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rabx-message

  • 0.0.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

RPC using Anything But XML (RABX) message parser and emitter

Gem Version Build Status Dependency Status Coverage Status Code Climate

The RABX specification is a Perl module by mySociety.

Usage

require 'rabx/message'

Dump a RABX message:

RABX::Message.dump('R', 'RPC.method', ['argument', 3])
# => "R1:0,10:RPC.method,L1:2,T8:argument,I1:3,"
RABX::Message.dump('S', {name: 'foo', email: 'foo@example.com'})
# => "S1:0,A1:2,T4:name,T3:foo,T5:email,T15:foo@example.com,"
RABX::Message.dump('E', 404, 'Not Found')
# => "E1:0,3:404,9:Not Found,N"

Load a RABX message:

message = RABX::Message.load("R1:0,10:RPC.method,L1:2,T8:argument,I1:3,")
message.type # "R"
message.method # "RPC.method"
message.argumetns # ["argument", 3]

message = RABX::Message.load("S1:0,A1:2,T4:name,T3:foo,T5:email,T15:foo@example.com,")
message.type # "S"
message.value # {"name"=>"foo", "email"=>"foo@example.com"}

message = RABX::Message.load("E1:0,3:404,9:Not Found,N")
message.type # "E"
message.code # "404"
message.text # "Not Found"
message.extra # nil

See the documentation to see how to work with RABX::Message instances.

Notes

Generic RABX clients include:

mySociety has scripts to convert a Perl RABX server to a server-specific client in:

Copyright (c) 2014 James McKinney, released under the MIT license

FAQs

Package last updated on 25 Jan 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc