Project

rdecorator

0.0
No commit activity in last 3 years
No release in over 3 years
Python like decorator in ruby
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.13
~> 0.7
~> 10.0
~> 3.4
 Project Readme

RDecorator

Build Status Coverage Status Dependency Status Code Climate

Rdecorator is an Pyhton like decorator use for AOP pattern programming

Installation

Add this line to your application's Gemfile:

gem 'rdecorator'

And then execute:

$ bundle

Usage

Basic

class Language
  extend Rdecorator

  def best(this, args)
    'best Language' + this.call(args)	
  end

  wrap :best
  def ruby
    'ruby'	
  end
end

Language.new.ruby #=> best Language ruby

Decorator Class

class Decorator 

  include Rdecorator

  def call
    'say fucking' + @this.call(*@args)
  end
end

class DummyClass

  decorator Decorator
  def say(hello)
    'hello'	
  end

end

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/falm/rdecorator.