Skip to content

SixArm » Ruby » Blob gem for simple access to a file, URI, upload, etc.

License

Notifications You must be signed in to change notification settings

SixArm/sixarm_ruby_blob

Repository files navigation

SixArm.com → Ruby →
Blob of data abstract base class

Gem Version Build Status Code Climate

Introduction

This is an abstract base class to help us model a blob of data.

We use this class as our parent class for image files, music files, and video files.

A blob provides a few basic capabilities:

  • Access a blob via a file path on the local filesystem.
  • Access a blob via a URI.
  • Upload a blob by using a typical web browser form.

For docs go to http://sixarm.com/sixarm_ruby_blob/doc

Want to help? We're happy to get pull requests.

Install

Gem

To install this gem in your shell or terminal:

gem install sixarm_ruby_blob

Gemfile

To add this gem to your Gemfile:

gem 'sixarm_ruby_blob'

Require

To require the gem in your code:

require 'sixarm_ruby_blob'

Examples

Create a blob:

require "sixarm_ruby_blob"
blob = Blob.new(dir: "/my/photos", name: "photo.jpb")

Locate the blob as a file and as a URI:

blob.file_path #=> "/my/photos/photo.jpg"
blob.uri_path #=> "http://example.com/my/photos/photo.jpg"

About

SixArm » Ruby » Blob gem for simple access to a file, URI, upload, etc.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages