Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/inaki-ibarra/oop-design-patterns
Examples of OOP design patterns written in Ruby
https://github.com/inaki-ibarra/oop-design-patterns
examples-ruby oop patterns ruby
Last synced: 20 days ago
JSON representation
Examples of OOP design patterns written in Ruby
- Host: GitHub
- URL: https://github.com/inaki-ibarra/oop-design-patterns
- Owner: inaki-ibarra
- Created: 2020-02-10T07:12:59.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-02-20T12:23:29.000Z (almost 5 years ago)
- Last Synced: 2024-11-14T11:41:38.820Z (3 months ago)
- Topics: examples-ruby, oop, patterns, ruby
- Language: Ruby
- Homepage:
- Size: 49.8 KB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# :card_file_box: OOP Design Patterns Ruby Examples
This repo contains various examples of common design patterns for Object Oriented Programming written in Ruby. The goal is to show how to implement these patterns with Ruby which is dynamically typed, doesn't have interface, method overloading and other concepts that are present in a typical object-oriented language.
## Creational Design Patterns
- [Factory Method](creational/factory_method)
- [Abstract Factory](creational/abstract_factory)
- [Builder](creational/builder)
- [Prototype](creational/prototype)
- [Singleton](creational/singleton)## Structural Design Patterns
- [Adapter](structural/adapter)
- [Bridge](structural/bridge)
- [Composite](structural/composite)
- [Decorator](structural/decorator)
- [Facade](structural/facade)
- [Flyweight](structural/flyweight)
- [Proxy](structural/proxy)## Behavioral Design Patterns
- [Chain of Responsibility](behavioral/chain_of_responsibility)
- [Command](behavioral/command)
- [Iterator](behavioral/iterator)
- [Mediator](behavioral/mediator)
- [Memento](behavioral/memento)
- [Observer](behavioral/observer)
- [State](behavioral/state)
- [Strategy](behavioral/strategy)
- [Template Method](behavioral/template_method)
- [Visitor](behavioral/visitor)## Usage and Testing
You can run each pattern with Ruby. For example:
`ruby -r './app.rb' -e 'Singleton::App.new.main'`
You can also run tests with RSpec. Tests are provided and located in `/spec`.
## Contributing
The examples here are open for improvement so feel free to report issues, add documentations, modify examples and send pull requests.