Skip to content

falm/rdecorator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

yet another ruby decorator

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published