├── .gitignore ├── Adapter ├── encrypter.rb ├── stringio_adapter.rb └── text_renderer_example.rb ├── Builder ├── computer.rb ├── computer_builder.rb ├── desktop_builder.rb ├── laptop_builder.rb ├── parts.rb └── program.rb ├── Command ├── add_employee.rb ├── change_address.rb ├── command.rb ├── composite_command.rb ├── copy_file.rb ├── create_file.rb ├── delete_employee.rb ├── delete_file.rb ├── employee.rb ├── employee_manager.rb ├── execute_commands.rb ├── execute_employee_example.rb ├── find_employee.rb └── slick_button.rb ├── Composite ├── add_dry_ingredients_task.rb ├── add_liquid_task.rb ├── composite_task.rb ├── composite_task_spec.rb ├── make_batter_task.rb ├── mix_task.rb ├── program.rb └── task.rb ├── Decorator ├── checksumming_writer.rb ├── enhanced_writer.rb ├── numbering_writer.rb ├── simple_writer.rb ├── timestamping_writer.rb ├── try_writer.rb ├── using_modules.rb └── writer_decorator.rb ├── Factory ├── algea.rb ├── duck.rb ├── frog.rb ├── organism_factory.rb ├── pond.rb ├── pond_factory.rb ├── tiger.rb └── tree.rb ├── Interpreter ├── and.rb ├── bigger.rb ├── expression.rb ├── file_name.rb ├── not.rb ├── or.rb ├── parser.rb ├── try_expressions.rb ├── try_runt.rb └── writable.rb ├── Iterator ├── account.rb ├── array_iterator.rb ├── array_iterator_spec.rb ├── portfolio.rb ├── sorted_array_merger.rb └── sorted_array_merger_spec.rb ├── MetaProgramming ├── animals.rb └── new_plant.rb ├── Observer ├── employee.rb ├── employee_spec.rb ├── payroll.rb ├── program.rb ├── subject.rb └── tax_man.rb ├── Proxy ├── account_protection_proxy.rb ├── bank_account.rb ├── bank_account_proxy.rb ├── try_bank_account.rb ├── universal_account_proxy.rb ├── virtual_account_proxy.rb └── webservice_proxy.rb ├── Strategy ├── program.rb └── report.rb └── TemplateMethod ├── html_report.rb ├── plain_text_report.rb ├── program.rb └── report.rb /.gitignore: -------------------------------------------------------------------------------- 1 | Command/employees/* -------------------------------------------------------------------------------- /Adapter/encrypter.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adomokos/DesignPatterns-Ruby/HEAD/Adapter/encrypter.rb -------------------------------------------------------------------------------- /Adapter/stringio_adapter.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adomokos/DesignPatterns-Ruby/HEAD/Adapter/stringio_adapter.rb -------------------------------------------------------------------------------- /Adapter/text_renderer_example.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adomokos/DesignPatterns-Ruby/HEAD/Adapter/text_renderer_example.rb -------------------------------------------------------------------------------- /Builder/computer.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adomokos/DesignPatterns-Ruby/HEAD/Builder/computer.rb -------------------------------------------------------------------------------- /Builder/computer_builder.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adomokos/DesignPatterns-Ruby/HEAD/Builder/computer_builder.rb -------------------------------------------------------------------------------- /Builder/desktop_builder.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adomokos/DesignPatterns-Ruby/HEAD/Builder/desktop_builder.rb -------------------------------------------------------------------------------- /Builder/laptop_builder.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adomokos/DesignPatterns-Ruby/HEAD/Builder/laptop_builder.rb -------------------------------------------------------------------------------- /Builder/parts.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adomokos/DesignPatterns-Ruby/HEAD/Builder/parts.rb -------------------------------------------------------------------------------- /Builder/program.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adomokos/DesignPatterns-Ruby/HEAD/Builder/program.rb -------------------------------------------------------------------------------- /Command/add_employee.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adomokos/DesignPatterns-Ruby/HEAD/Command/add_employee.rb -------------------------------------------------------------------------------- /Command/change_address.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adomokos/DesignPatterns-Ruby/HEAD/Command/change_address.rb -------------------------------------------------------------------------------- /Command/command.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adomokos/DesignPatterns-Ruby/HEAD/Command/command.rb -------------------------------------------------------------------------------- /Command/composite_command.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adomokos/DesignPatterns-Ruby/HEAD/Command/composite_command.rb -------------------------------------------------------------------------------- /Command/copy_file.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adomokos/DesignPatterns-Ruby/HEAD/Command/copy_file.rb -------------------------------------------------------------------------------- /Command/create_file.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adomokos/DesignPatterns-Ruby/HEAD/Command/create_file.rb -------------------------------------------------------------------------------- /Command/delete_employee.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adomokos/DesignPatterns-Ruby/HEAD/Command/delete_employee.rb -------------------------------------------------------------------------------- /Command/delete_file.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adomokos/DesignPatterns-Ruby/HEAD/Command/delete_file.rb -------------------------------------------------------------------------------- /Command/employee.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adomokos/DesignPatterns-Ruby/HEAD/Command/employee.rb -------------------------------------------------------------------------------- /Command/employee_manager.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adomokos/DesignPatterns-Ruby/HEAD/Command/employee_manager.rb -------------------------------------------------------------------------------- /Command/execute_commands.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adomokos/DesignPatterns-Ruby/HEAD/Command/execute_commands.rb -------------------------------------------------------------------------------- /Command/execute_employee_example.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adomokos/DesignPatterns-Ruby/HEAD/Command/execute_employee_example.rb -------------------------------------------------------------------------------- /Command/find_employee.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adomokos/DesignPatterns-Ruby/HEAD/Command/find_employee.rb -------------------------------------------------------------------------------- /Command/slick_button.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adomokos/DesignPatterns-Ruby/HEAD/Command/slick_button.rb -------------------------------------------------------------------------------- /Composite/add_dry_ingredients_task.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adomokos/DesignPatterns-Ruby/HEAD/Composite/add_dry_ingredients_task.rb -------------------------------------------------------------------------------- /Composite/add_liquid_task.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adomokos/DesignPatterns-Ruby/HEAD/Composite/add_liquid_task.rb -------------------------------------------------------------------------------- /Composite/composite_task.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adomokos/DesignPatterns-Ruby/HEAD/Composite/composite_task.rb -------------------------------------------------------------------------------- /Composite/composite_task_spec.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adomokos/DesignPatterns-Ruby/HEAD/Composite/composite_task_spec.rb -------------------------------------------------------------------------------- /Composite/make_batter_task.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adomokos/DesignPatterns-Ruby/HEAD/Composite/make_batter_task.rb -------------------------------------------------------------------------------- /Composite/mix_task.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adomokos/DesignPatterns-Ruby/HEAD/Composite/mix_task.rb -------------------------------------------------------------------------------- /Composite/program.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adomokos/DesignPatterns-Ruby/HEAD/Composite/program.rb -------------------------------------------------------------------------------- /Composite/task.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adomokos/DesignPatterns-Ruby/HEAD/Composite/task.rb -------------------------------------------------------------------------------- /Decorator/checksumming_writer.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adomokos/DesignPatterns-Ruby/HEAD/Decorator/checksumming_writer.rb -------------------------------------------------------------------------------- /Decorator/enhanced_writer.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adomokos/DesignPatterns-Ruby/HEAD/Decorator/enhanced_writer.rb -------------------------------------------------------------------------------- /Decorator/numbering_writer.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adomokos/DesignPatterns-Ruby/HEAD/Decorator/numbering_writer.rb -------------------------------------------------------------------------------- /Decorator/simple_writer.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adomokos/DesignPatterns-Ruby/HEAD/Decorator/simple_writer.rb -------------------------------------------------------------------------------- /Decorator/timestamping_writer.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adomokos/DesignPatterns-Ruby/HEAD/Decorator/timestamping_writer.rb -------------------------------------------------------------------------------- /Decorator/try_writer.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adomokos/DesignPatterns-Ruby/HEAD/Decorator/try_writer.rb -------------------------------------------------------------------------------- /Decorator/using_modules.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adomokos/DesignPatterns-Ruby/HEAD/Decorator/using_modules.rb -------------------------------------------------------------------------------- /Decorator/writer_decorator.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adomokos/DesignPatterns-Ruby/HEAD/Decorator/writer_decorator.rb -------------------------------------------------------------------------------- /Factory/algea.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adomokos/DesignPatterns-Ruby/HEAD/Factory/algea.rb -------------------------------------------------------------------------------- /Factory/duck.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adomokos/DesignPatterns-Ruby/HEAD/Factory/duck.rb -------------------------------------------------------------------------------- /Factory/frog.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adomokos/DesignPatterns-Ruby/HEAD/Factory/frog.rb -------------------------------------------------------------------------------- /Factory/organism_factory.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adomokos/DesignPatterns-Ruby/HEAD/Factory/organism_factory.rb -------------------------------------------------------------------------------- /Factory/pond.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adomokos/DesignPatterns-Ruby/HEAD/Factory/pond.rb -------------------------------------------------------------------------------- /Factory/pond_factory.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adomokos/DesignPatterns-Ruby/HEAD/Factory/pond_factory.rb -------------------------------------------------------------------------------- /Factory/tiger.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adomokos/DesignPatterns-Ruby/HEAD/Factory/tiger.rb -------------------------------------------------------------------------------- /Factory/tree.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adomokos/DesignPatterns-Ruby/HEAD/Factory/tree.rb -------------------------------------------------------------------------------- /Interpreter/and.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adomokos/DesignPatterns-Ruby/HEAD/Interpreter/and.rb -------------------------------------------------------------------------------- /Interpreter/bigger.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adomokos/DesignPatterns-Ruby/HEAD/Interpreter/bigger.rb -------------------------------------------------------------------------------- /Interpreter/expression.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adomokos/DesignPatterns-Ruby/HEAD/Interpreter/expression.rb -------------------------------------------------------------------------------- /Interpreter/file_name.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adomokos/DesignPatterns-Ruby/HEAD/Interpreter/file_name.rb -------------------------------------------------------------------------------- /Interpreter/not.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adomokos/DesignPatterns-Ruby/HEAD/Interpreter/not.rb -------------------------------------------------------------------------------- /Interpreter/or.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adomokos/DesignPatterns-Ruby/HEAD/Interpreter/or.rb -------------------------------------------------------------------------------- /Interpreter/parser.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adomokos/DesignPatterns-Ruby/HEAD/Interpreter/parser.rb -------------------------------------------------------------------------------- /Interpreter/try_expressions.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adomokos/DesignPatterns-Ruby/HEAD/Interpreter/try_expressions.rb -------------------------------------------------------------------------------- /Interpreter/try_runt.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adomokos/DesignPatterns-Ruby/HEAD/Interpreter/try_runt.rb -------------------------------------------------------------------------------- /Interpreter/writable.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adomokos/DesignPatterns-Ruby/HEAD/Interpreter/writable.rb -------------------------------------------------------------------------------- /Iterator/account.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adomokos/DesignPatterns-Ruby/HEAD/Iterator/account.rb -------------------------------------------------------------------------------- /Iterator/array_iterator.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adomokos/DesignPatterns-Ruby/HEAD/Iterator/array_iterator.rb -------------------------------------------------------------------------------- /Iterator/array_iterator_spec.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adomokos/DesignPatterns-Ruby/HEAD/Iterator/array_iterator_spec.rb -------------------------------------------------------------------------------- /Iterator/portfolio.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adomokos/DesignPatterns-Ruby/HEAD/Iterator/portfolio.rb -------------------------------------------------------------------------------- /Iterator/sorted_array_merger.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adomokos/DesignPatterns-Ruby/HEAD/Iterator/sorted_array_merger.rb -------------------------------------------------------------------------------- /Iterator/sorted_array_merger_spec.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adomokos/DesignPatterns-Ruby/HEAD/Iterator/sorted_array_merger_spec.rb -------------------------------------------------------------------------------- /MetaProgramming/animals.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adomokos/DesignPatterns-Ruby/HEAD/MetaProgramming/animals.rb -------------------------------------------------------------------------------- /MetaProgramming/new_plant.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adomokos/DesignPatterns-Ruby/HEAD/MetaProgramming/new_plant.rb -------------------------------------------------------------------------------- /Observer/employee.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adomokos/DesignPatterns-Ruby/HEAD/Observer/employee.rb -------------------------------------------------------------------------------- /Observer/employee_spec.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adomokos/DesignPatterns-Ruby/HEAD/Observer/employee_spec.rb -------------------------------------------------------------------------------- /Observer/payroll.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adomokos/DesignPatterns-Ruby/HEAD/Observer/payroll.rb -------------------------------------------------------------------------------- /Observer/program.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adomokos/DesignPatterns-Ruby/HEAD/Observer/program.rb -------------------------------------------------------------------------------- /Observer/subject.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adomokos/DesignPatterns-Ruby/HEAD/Observer/subject.rb -------------------------------------------------------------------------------- /Observer/tax_man.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adomokos/DesignPatterns-Ruby/HEAD/Observer/tax_man.rb -------------------------------------------------------------------------------- /Proxy/account_protection_proxy.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adomokos/DesignPatterns-Ruby/HEAD/Proxy/account_protection_proxy.rb -------------------------------------------------------------------------------- /Proxy/bank_account.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adomokos/DesignPatterns-Ruby/HEAD/Proxy/bank_account.rb -------------------------------------------------------------------------------- /Proxy/bank_account_proxy.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adomokos/DesignPatterns-Ruby/HEAD/Proxy/bank_account_proxy.rb -------------------------------------------------------------------------------- /Proxy/try_bank_account.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adomokos/DesignPatterns-Ruby/HEAD/Proxy/try_bank_account.rb -------------------------------------------------------------------------------- /Proxy/universal_account_proxy.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adomokos/DesignPatterns-Ruby/HEAD/Proxy/universal_account_proxy.rb -------------------------------------------------------------------------------- /Proxy/virtual_account_proxy.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adomokos/DesignPatterns-Ruby/HEAD/Proxy/virtual_account_proxy.rb -------------------------------------------------------------------------------- /Proxy/webservice_proxy.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adomokos/DesignPatterns-Ruby/HEAD/Proxy/webservice_proxy.rb -------------------------------------------------------------------------------- /Strategy/program.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adomokos/DesignPatterns-Ruby/HEAD/Strategy/program.rb -------------------------------------------------------------------------------- /Strategy/report.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adomokos/DesignPatterns-Ruby/HEAD/Strategy/report.rb -------------------------------------------------------------------------------- /TemplateMethod/html_report.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adomokos/DesignPatterns-Ruby/HEAD/TemplateMethod/html_report.rb -------------------------------------------------------------------------------- /TemplateMethod/plain_text_report.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adomokos/DesignPatterns-Ruby/HEAD/TemplateMethod/plain_text_report.rb -------------------------------------------------------------------------------- /TemplateMethod/program.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adomokos/DesignPatterns-Ruby/HEAD/TemplateMethod/program.rb -------------------------------------------------------------------------------- /TemplateMethod/report.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adomokos/DesignPatterns-Ruby/HEAD/TemplateMethod/report.rb --------------------------------------------------------------------------------