New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More

delano-storable

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

delano-storable


Version published
Maintainers
1
Created

= Storable - v0.5

Marshal Ruby classes into and out of multiple formats (yaml, json, csv, tsv)

== Example

require 'storable'

class Machine < Storable
  field :environment            # Define field names for Machine. The
  field :role                   # default type is String, but you can
  field :position => Integer    # specify a type using a hash syntax.
end

mac1 = Machine.new              # Instances of Machine have accessors
mac1.environment = "stage"      # just like regular attributes. 
mac1.role = "app"
mac1.position = 1

puts "# YAML", mac1.to_yaml     # Note: the field order is maintained     
puts "# CSV", mac1.to_csv       # => stage,app,1
puts "# JSON", mac1.to_json     # Note: field order not maintained.

mac2 = Machine.from_yaml(mac1.to_yaml)
puts mac2.environment           # => "stage"
puts mac2.position.class        # => Fixnum

== Installation

Via Rubygems, one of:

$ sudo gem install storable
$ sudo gem install delano-storable --source http://gems.github.com/

or via download:

== Prerequisites

  • Ruby 1.8, Ruby 1.9, or JRuby 1.2

== Thanks

== Credits

== License

See: LICENSE.txt

FAQs

Package last updated on 11 Aug 2014

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