Skip to content

Latest commit

 

History

32 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages