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

dependancy

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dependancy

  • 0.0.6
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Dependancy

Getters & setters for dependency injection

Installation

Add this line to your application's Gemfile:

gem 'dependancy'

And then execute:

$ bundle

Or install it yourself as:

$ gem install dependancy

Usage

class Bar
  attr_accessor :name
end

class Foo
  extend Dependancy

  def name
    'foo name'
  end

  dependancy :bar1 do
    Bar.new
  end

  dependancy :bar2 do |foo|
    bar = Bar.new
    bar.name = foo.name
    bar
  end

  dependancy :bar3
end

Foo._dependancies == [:bar1, :bar2, :bar3] # true
foo = Foo.new
foo.bar1.is_a? Bar # true
foo.bar2.is_a? Bar # true
foo.bar2.name == foo.name # true

bar = Bar.new
foo = Foo.bild bar: bar
foo.bar == bar # true

foo = Dependancy::Bild.bild Foo, bar: bar
foo.bar == bar # true

Tested in ruby 1.9.2 Build Status

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

FAQs

Package last updated on 16 Mar 2012

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