In this talk from Triangle.rb, Cory Foy goes over basic language features of Ruby, along with some gotchas from David Black's "The Well Grounded Rubyist". We cover variables, classes, blocks, and other aspects.
These are the slides from Robert "Uncle Bob" Martin's talk at the Chicago Day of Mobile event held in March 2010. 際際滷s posted with permission from Bob.
The document discusses Innovation Games, which are serious games used to solve product strategy and management problems. Innovation Games are played with customers, stakeholders, online or in-person. They work to manage roadmaps, identify new products, train sales teams, and more. Some example games described are Product Box, Speed Boat, Prune the Product Tree, and Spider Web. Case studies show how companies like Wyse Technologies, Qualcomm, and Aladdin Knowledge Systems have used Innovation Games to get customer feedback and insights to improve their products.
Part of this Agile Requirements Workshop was to do a 20/20 Vision ranking game with the participants to understand and discuss what their "Biggest Challenge" is in Agile Requirements. This is draft one of the team's ranking of these challenges. More context will be forthcoming.
Many companies have created a proper noun titled "Agile". But that word doesn't exist as a proper noun. The goal isn't to achieve some mythical ethos of "Agile" but instead to have organizational agility. This presentation covers the principles of Organizational Agility and how to make your organization get to the goal of agility.
Triangle.rb - How Secure is Your Rails Site, Anyway?Cory Foy
油
In this talk from Triangle.rb, Cory Foy details the state of Rails security, including paying attention to libraries you use. He includes real world examples of exploits, and links to resources
In this talk from Southern Fried Agile 2014, Cory Foy gives an overview of the patterns necessary to have successful agility when working with distributed and dispersed teams. He looks at Scrum, Kanban and various virtual tools.
In this talk from Red Hat's 2014 Agile Conference, Cory Foy talks about the conditions necessary to bring about true organizational change towards agility. In addition, he covers patterns of adoptions and a variety of techniques used at scale
In this talk from GOTO Berlin 2013, Cory Foy discusses the importance of listening to your code to know when to refactor, test, and build solutions which will withstand the test of time.
The document discusses the idea that code "cries" when it is difficult to understand and modify. It suggests reframing "code smells" as issues where the code is trying to communicate something but is not being understood. The author argues that software becomes harder to work with over time because developers try to force their own designs rather than letting the code evolve naturally through an iterative process. Developers are encouraged to let go of preconceived designs and diagrams in order to build code in a more organic, timeless way.
In this talk from a Tampa 8th Light University, Senior Craftsman Cory Foy details the design patterns used in Rails, and shows their use and implementation while reference Fowler's PoEAA and Alexander's Timeless Way of Building
Collaborating with Customers using Innovation GameEnthiosys Inc
油
Scott Gilbert, Enthiosys president, at EMC's Innovation & Leadership Series (22-Apr-09) on "Collaborating with Customers using Innovation Games速". Session included overview of Innovation Games; real-world examples; collaboration techniques vs. traditional market research. Scott led group in a live Innovation Game.
This document discusses synchronizing multiple Scrum teams using Kanban principles. It begins with an overview of Scrum and problems with multi-team coordination. It then provides a overview of Kanban and key concepts like one-piece flow and limiting work-in-progress. The document applies these Kanban concepts to Scrum by removing iterations and instead using completed stories as synchronization points between teams. It advocates for decoupling Scrum activities from iterations to allow continuous work and integration.
Agile Roots: The Agile Mindset - Agility Across the OrganizationCory Foy
油
In this talk from Agile Roots 2014, Cory Foy talks about what is necessary for agility across the entire enterprise - regardless of whether you are using Agile, Lean, or Waterfall. Cory also covers the three principles and four value statements of agility.
Choosing Between Scrum and Kanban - TriAgile 2015Cory Foy
油
The document compares and contrasts the Scrum and Kanban frameworks. Scrum is a framework that utilizes roles, artifacts, and events like sprints, stand-ups, and planning. Kanban focuses on visualizing workflow, limiting work-in-process, measuring and managing flow, making policies explicit, and using models for continuous improvement. Both aim to provide structure, frequent feedback, and adapting processes through inspecting outcomes. However, Kanban emphasizes evolutionary change through techniques like limiting work-in-process while Scrum relies more on timeboxed sprints.
In the software development world, we spend a lot of our time coding, and very little practicing. In this presentation to the Triangle.rb group, Smashing Boxes CTO Cory Foy talks about a focused development practice called Code Katas - and how they can help you improve your hiring, your team, and your own programming abilities
Stratgic Play - Doing the Right Thing at the Right TimeCory Foy
油
In this talk from Red Hat Agile Day 2015, Cory Foy covers the notion of Strategic Play by covering tools like Wardley Maps, Business Model Canvas, Purpose-Based Alignment Model and Product Vision Statement
Continuous Deployment and Testing Workshop from Better Software WestCory Foy
油
In this workshop from the 2015 SQE Better Software West conference, Cory Foy details the Continuous Paradigm companies are embracing - including Continuous Integration, Continuous Deployment, and Continuous Testing. This presentation was co-created by Jared Richardson.
Originally Monster World was developed with Scrum. The scrum process resulted in some inefficiencies and missing flexibility. Hence, some elements of Kanban were introduced. In this talk, we present the experience of this Scrum/Kanban mix which has been used for 6 months.
Updated version at /GiulioRoggero/kanban-board-82363781
Do you have a team that works on both project and maintenance? Do you need to organize your team activities? Do you have a lot of activities in parallel and the time to market it's a problem? With a Kanban board and an Agile approach you can solve your problems!
Take a look of the animation of the slides to discover how it works.
The Design Thinking division at the University of St. Gallen has been successfully helping companies innovate since 2008. They use the human-centered Design Thinking process pioneered by Stanford to understand user needs through prototyping. The iterative process involves defining problems based on research, ideating solutions, prototyping ideas rapidly, and getting user feedback to refine solutions. The division guides students and companies through this process to generate new business opportunities.
Defending Commoditization: Mapping Gameplays and Strategies to Stay Ahead in ...Cory Foy
油
One of the goals of agility is to be able to respond rapidly to market change. But do you feel prepared to wake up to a product announcement from Amazon disrupting your entire business? Would you know what steps to take?
Instead of being worried, we can get mapping! Wardley Mapping, coined by Simon Wardley, is a way of understanding markets and components in a way that allows us to visualize and anticipate change in markets - and develop strategies and gameplays for how we can respond to them.
This session uses several real-world cases of work with organizations to map their landscape and show the strategies and gameplays that allowed them to reshape where they were headed - and allow you to understand your organizations market and how you can think about features and product direction.
This document discusses the importance of listening to code to understand what it is communicating. It recommends deciding to listen, listening for the whole message without personal biases, being patient, curious, and testing your understanding. Other topics covered include katas, koans, adding new features, design principles like SOLID, commonality/variability analysis, and the need for context to truly understand code.
Getting Unstuck: Working with Legacy Code and DataCory Foy
油
From this presentation for the IASA in 2007, Cory covers common challenges in dealing with Legacy Code and Data, and some tools and techniques for handling them.
In this session from redev 2010 in Malm旦, Sweden, Cory Foy tackles what it takes to foster Software Craftsmanship and why it's so important to value those people who are taking responsibility for their careers
In this talk from GOTO Berlin 2013, Cory Foy discusses the importance of listening to your code to know when to refactor, test, and build solutions which will withstand the test of time.
The document discusses the idea that code "cries" when it is difficult to understand and modify. It suggests reframing "code smells" as issues where the code is trying to communicate something but is not being understood. The author argues that software becomes harder to work with over time because developers try to force their own designs rather than letting the code evolve naturally through an iterative process. Developers are encouraged to let go of preconceived designs and diagrams in order to build code in a more organic, timeless way.
In this talk from a Tampa 8th Light University, Senior Craftsman Cory Foy details the design patterns used in Rails, and shows their use and implementation while reference Fowler's PoEAA and Alexander's Timeless Way of Building
Collaborating with Customers using Innovation GameEnthiosys Inc
油
Scott Gilbert, Enthiosys president, at EMC's Innovation & Leadership Series (22-Apr-09) on "Collaborating with Customers using Innovation Games速". Session included overview of Innovation Games; real-world examples; collaboration techniques vs. traditional market research. Scott led group in a live Innovation Game.
This document discusses synchronizing multiple Scrum teams using Kanban principles. It begins with an overview of Scrum and problems with multi-team coordination. It then provides a overview of Kanban and key concepts like one-piece flow and limiting work-in-progress. The document applies these Kanban concepts to Scrum by removing iterations and instead using completed stories as synchronization points between teams. It advocates for decoupling Scrum activities from iterations to allow continuous work and integration.
Agile Roots: The Agile Mindset - Agility Across the OrganizationCory Foy
油
In this talk from Agile Roots 2014, Cory Foy talks about what is necessary for agility across the entire enterprise - regardless of whether you are using Agile, Lean, or Waterfall. Cory also covers the three principles and four value statements of agility.
Choosing Between Scrum and Kanban - TriAgile 2015Cory Foy
油
The document compares and contrasts the Scrum and Kanban frameworks. Scrum is a framework that utilizes roles, artifacts, and events like sprints, stand-ups, and planning. Kanban focuses on visualizing workflow, limiting work-in-process, measuring and managing flow, making policies explicit, and using models for continuous improvement. Both aim to provide structure, frequent feedback, and adapting processes through inspecting outcomes. However, Kanban emphasizes evolutionary change through techniques like limiting work-in-process while Scrum relies more on timeboxed sprints.
In the software development world, we spend a lot of our time coding, and very little practicing. In this presentation to the Triangle.rb group, Smashing Boxes CTO Cory Foy talks about a focused development practice called Code Katas - and how they can help you improve your hiring, your team, and your own programming abilities
Stratgic Play - Doing the Right Thing at the Right TimeCory Foy
油
In this talk from Red Hat Agile Day 2015, Cory Foy covers the notion of Strategic Play by covering tools like Wardley Maps, Business Model Canvas, Purpose-Based Alignment Model and Product Vision Statement
Continuous Deployment and Testing Workshop from Better Software WestCory Foy
油
In this workshop from the 2015 SQE Better Software West conference, Cory Foy details the Continuous Paradigm companies are embracing - including Continuous Integration, Continuous Deployment, and Continuous Testing. This presentation was co-created by Jared Richardson.
Originally Monster World was developed with Scrum. The scrum process resulted in some inefficiencies and missing flexibility. Hence, some elements of Kanban were introduced. In this talk, we present the experience of this Scrum/Kanban mix which has been used for 6 months.
Updated version at /GiulioRoggero/kanban-board-82363781
Do you have a team that works on both project and maintenance? Do you need to organize your team activities? Do you have a lot of activities in parallel and the time to market it's a problem? With a Kanban board and an Agile approach you can solve your problems!
Take a look of the animation of the slides to discover how it works.
The Design Thinking division at the University of St. Gallen has been successfully helping companies innovate since 2008. They use the human-centered Design Thinking process pioneered by Stanford to understand user needs through prototyping. The iterative process involves defining problems based on research, ideating solutions, prototyping ideas rapidly, and getting user feedback to refine solutions. The division guides students and companies through this process to generate new business opportunities.
Defending Commoditization: Mapping Gameplays and Strategies to Stay Ahead in ...Cory Foy
油
One of the goals of agility is to be able to respond rapidly to market change. But do you feel prepared to wake up to a product announcement from Amazon disrupting your entire business? Would you know what steps to take?
Instead of being worried, we can get mapping! Wardley Mapping, coined by Simon Wardley, is a way of understanding markets and components in a way that allows us to visualize and anticipate change in markets - and develop strategies and gameplays for how we can respond to them.
This session uses several real-world cases of work with organizations to map their landscape and show the strategies and gameplays that allowed them to reshape where they were headed - and allow you to understand your organizations market and how you can think about features and product direction.
This document discusses the importance of listening to code to understand what it is communicating. It recommends deciding to listen, listening for the whole message without personal biases, being patient, curious, and testing your understanding. Other topics covered include katas, koans, adding new features, design principles like SOLID, commonality/variability analysis, and the need for context to truly understand code.
Getting Unstuck: Working with Legacy Code and DataCory Foy
油
From this presentation for the IASA in 2007, Cory covers common challenges in dealing with Legacy Code and Data, and some tools and techniques for handling them.
In this session from redev 2010 in Malm旦, Sweden, Cory Foy tackles what it takes to foster Software Craftsmanship and why it's so important to value those people who are taking responsibility for their careers
In this session from redev 2010 in Malm旦, Sweden, Cory Foy covers the concepts of Koans and Katas in the software world by explaining the concepts of learning models such as the Dreyfus Model of Skills Acquisition, Shu Ha Ri and others.
This was my presentation from the MIX10 conference in Las Vegas introducing Ruby and IronRuby to .NET Developers. Covers intergration with CLR, BCL and Silverlight
A presentation covering various tools used throughout an agile development lifecycle including NUnit, FitNesse, TeamCity and others. This was given at the South Florida Code Camp in March 2010.
Adobe After Effects Crack latest version 2025saniasabbba
油
艶COPY & PASTE LINK https://crack4pro.net/download-latest-windows-softwaresz/
Free Download Adobe After Effects CC Pre-Activated offline installer for Windows [Torrent + Direct Download Links] to create cinematic movie titles, intros, and transitions.
copy and past on google も https://drfiles.net/
SketchUp Pro Crack provides professionals with the tools to create detailed and accurate 3D models, visualize concepts, and communicate ideas effectively.SketchUp Pro, free and safe download. SketchUp Pro latest version: Explore boundless design possibilities with SketchUp Pro. Dive into the world of Sk.SketchUp Pro Crack With License Key 2025. SketchUp is a popular 3D modeling software used for a wide range of applications,
艶COPY & PASTE LINK https://crack4pro.net/download-latest-windows-softwaresz/
Free Download Adobe Illustrator CC Pre-Activated Offline Installer + Portable for Windows PC. The industry-standard vector graphics software lets you create logos, icons, drawings, typography, and illustrations for print, web, video, and mobile.
Click this link to download NOW : https://shorturl.at/zvrcM
Enscape Latest 2025 Crack is a real-time 3D rendering and virtual reality (VR) software that integrates seamlessly with architectural design software like Autodesk Revit, SketchUp, Rhino, ArchiCAD, and Vectorworks. It is widely used by architects, designers, and visualization professionals to create photorealistic visualizations, immersive virtual walkthroughs, and high-quality renderings directly from their 3D models.
Mastering Software Test Automation: A Comprehensive Guide for Beginners and E...Shubham Joshi
油
Software test automation is transforming the way teams ensure product quality, making testing faster, more efficient, and highly reliable. This guide covers everything from the basics to advanced concepts, helping both beginners and experts optimize their testing processes. Youll explore various automation tools, frameworks, and best practices to improve test accuracy and speed up development cycles. With software test automation, organizations can minimize manual effort while enhancing test coverage. Whether you're just starting out or refining your existing automation strategies, this guide provides actionable insights and real-world examples to help you achieve success in automated testing.
Click this link to download NOW : https://shorturl.at/zvrcM
Wondershare Filmora Crack is a user-friendly video editing software designed for both beginners and intermediate users. It provides an intuitive interface and powerful features that make it easy to create and edit high-quality videos without needing extensive video editing experience. It is popular among content creators, YouTubers, and anyone looking to create professional-looking videos for personal or business use.
Why Every Cables and Wires Manufacturer Needs a Cloud-Based ERP SolutionsAbsolute ERP
油
Investing in the right direction with Enterprise Resource Planning Software helps
businesses build a strong base. In this direction, cloud-enabled ERP solutions have become the
call of every manufacturing industry including the cables and wires industry.
艶COPY & PASTE LINK https://crack4pro.net/download-latest-windows-softwaresz/
Free Download Autodesk Revit for Windows PC. It includes features for architectural design, MEP and structural engineering, and construction. Revit supports a multidiscipline, collaborative design process.
Click this link to download NOW : https://shorturl.at/zvrcM
MiniTool Partition Wizard is a powerful and easy-to-use partition management tool designed to help users manage their hard drive partitions. It provides a variety of functions to help with partition creation, resizing, merging, splitting, formatting, and much more, making it a popular tool for users who need to optimize or manage their storage devices.
The financial technology landscape is evolving at an unprecedented pace, and 2025 promises to be a transformative year for the industry. From AI-driven banking to decentralized finance, the future of FinTech is brimming with innovation. In this carousel, we explore the five key trends that will shape the FinTech ecosystem in 2025. Stay ahead of the curve and discover how these advancements will redefine the way we manage, invest, and interact with money. Swipe through to dive into the future of finance! 叶
Instagram Feed Snippet, Instagram posts display in odoo websiteAxisTechnolabs
油
¥Instagram snippet Odoo module come with Completely responsive and mobile ready, layout looks great on screen, simple way to set up, display photos and thumbnail, display #instagram posts, increase your number of follwers exciting features
Visit Odoo 18 app link : https://bit.ly/3YMgiA3
Let's Checkout Some interesting key features of Odoo instagram Snippet :
Key features of Instagram Odoo Snippet :
Easy to Setup
Any Instagram Profile
Instagram UI Post
Fully Responsive instagram snippet in odoo
Faster Load More
And more....
Just click On below Odoo Instagram Snippet link and explore more exciting new features :
App download now :
Odoo 18 : https://bit.ly/3YMgiA3
Odoo 17 : https://bit.ly/4aiiZ0g
Odoo 16 : https://bit.ly/3WGPzCv
Odoo 15 : https://bit.ly/3LD8N6m
Odoo 14 : https://bit.ly/3K9wL8H
Odoo 13 : https://bit.ly/3DCiW0c
Explore more odoo Apps : https://bit.ly/3oFIOCF
Want A Free DEMO ? : business@axistechnolabs.com
Want to discuss ? : https://lnkd.in/gfXHqhU4
Looking Odoo services : https://lnkd.in/gjxHC4dd
Contact Us : 091066 49361
OutSystems User Group Utrecht February 2025.pdfmail496323
油
We'll first explore how to Transition from O11 to ODC with Solange Ferreira (OutSystems). After that, Remco Dekkinga (Evergreen IT) will jump into Troubleshooting.
Chapter 1 of Computer Organization and Architecture by Patterson and Hennessy, often referred to as the "Computer Organization and Design" (COD) book, serves as an introduction to the fundamental concepts of computer systems. It lays the groundwork for understanding how computers are designed and how they operate at both the hardware and software levels. The chapter begins by explaining the importance of abstraction in computer design, highlighting how layers of abstraction simplify the complexity of modern computing systems. Abstraction allows designers and programmers to focus on specific levels of a system without needing to understand every detail of the underlying layers, making it easier to build, optimize, and maintain complex systems.
The authors introduce the concept of the stored-program computer, a revolutionary idea where instructions and data are stored in memory, and the CPU fetches, decodes, and executes these instructions. This forms the basis of the von Neumann architecture, a cornerstone of modern computing. The von Neumann model is characterized by its sequential execution of instructions and its unified memory space for both data and programs. The chapter explains how this architecture enables the flexibility and programmability that define modern computers.
The chapter also discusses the roles of key components in a computer system, such as the CPU (Central Processing Unit), memory, and I/O (Input/Output) devices, and how they interact to execute programs. The CPU is described as the brain of the computer, responsible for performing arithmetic and logical operations, while memory stores data and instructions temporarily or permanently. I/O devices facilitate communication between the computer and the external world, enabling input from users and output to displays or other peripherals.
A significant portion of the chapter is dedicated to the concept of performance in computer systems. The authors introduce metrics like response time (the time it takes to complete a task) and throughput (the number of tasks completed per unit of time). They explain how these metrics are influenced by hardware and software optimizations, such as faster processors, larger memory, and efficient algorithms. The chapter also touches on the trade-offs involved in improving performance, such as the cost, power consumption, and complexity of hardware components.
The chapter emphasizes the importance of instruction set architecture (ISA), which serves as the interface between hardware and software. The ISA defines the set of instructions that a CPU can execute, as well as the registers, memory addressing modes, and data types it supports. Understanding the ISA is crucial for both hardware designers, who implement it, and software developers, who write programs that run on it.
To illustrate these concepts, the chapter often uses real-world examples and analogies, making the material accessible to readers with varying levels of prior knowledge.
iTop VPN Latest Version 2025 Crack Free Downloadlr74xqnvuf
油
Click this link to download NOW : https://shorturl.at/zvrcM
iTop VPN Latest Version 2025 Crack is a popular VPN (Virtual Private Network) service that offers privacy, security, and anonymity for users on the internet. It provides users with a way to protect their online activities from surveillance, bypass geo-restrictions, and enhance their security while browsing the web.
In 2025, AI-powered cyber threats are growing, but so are AI-driven security measures! Heres how were fighting back:
AI-Powered Fraud Detection Spot & stop attacks in real-time
Behavioral Biometrics AI learns user behavior & detects anomalies
Adaptive Security Models Auto-adjust security levels based on risk
AI-Powered Encryption Data stays safe, even in transit
At iProgrammer, we build intelligent, AI-driven security solutions to keep your app one step ahead of cyber threats!
How secure is your app? Lets talk!
https://www.iprogrammer.com/mobile-app-development-service/
Online Software Testing Training Institute in Delhi NcrHome
油
Geekonik is a chief Online Computer program Testing Preparing Founded in Delhi NCR, advertising expert-led courses in manual testing, computerization testing (Selenium, Appium), API testing, and execution testing. Our preparing incorporates hands-on ventures, real-world case ponders, and certification programs, guaranteeing industry-ready abilities. With adaptable online classes, personalized mentorship, and work situation help, we offer assistance you construct a fruitful career in program testing. Connect Geekonik nowadays and improve your specialized skill with cutting-edge program testing methodologies!
AI/ML Infra Meetup | Optimizing ML Data Access with Alluxio: Preprocessing, ...Alluxio, Inc.
油
AI/ML Infra Meetup
Mar. 06, 2025
Organized by Alluxio
For more Alluxio Events: https://www.alluxio.io/events/
Speaker:
- Bin Fan (VP of Technology @ Alluxio)
In this talk, Bin Fan shares his insights on data access challenges in ML applications, with particular emphasis on how Alluxio's distributed caching helps bridge the gap between storage and compute in preprocessing, pretraining and inference.
Click this link to download NOW : https://shorturl.at/zvrcM
LDPlayer 9.1.20 Latest crack is a powerful and user-friendly Android emulator that offers great performance and features for both casual users and gamers. With high performance, multi-instance support, customizable controls, and strong compatibility with Android apps and games, It is an excellent choice for anyone looking to run Android software on a PC.
1. Ruby and OO
Cory Foy | @cory_foy
http://www.coryfoy.com
Triangle.rb
June 24, 2014
Thursday, June 26, 14
2. Triangle.rb Meetup
June 25th, 2012
Cory Foy | @cory_foy
http://www.coryfoy.com
Ruby and OO
Overview
What is Ruby?
Ruby Basics
Advanced Ruby
Wrap-up
Thursday, June 26, 14
3. Triangle.rb Meetup
June 25th, 2012
Cory Foy | @cory_foy
http://www.coryfoy.com
Ruby and OO
What is Ruby?
First released in 1995 by Yukihiro
Matsumoto (Matz)
Object-Oriented
number = 1.abs #instead of Math.abs(1)
Dynamically Typed
result = 1+3
Thursday, June 26, 14
4. Triangle.rb Meetup
June 25th, 2012
Cory Foy | @cory_foy
http://www.coryfoy.com
Ruby and OO
What is Ruby?
http://www.rubygarden.org/faq/entry/show/3
class Person
attr_accessor :name, :age # attributes we can set and retrieve
def initialize(name, age) # constructor method
@name = name # store name and age for later retrieval
@age = age.to_i
# (store age as integer)
end
def inspect # This method retrieves saved values
"#{@name} (#{@age})" # in a readable format
end
end
p1 = Person.new('elmo', 4) # elmo is the name, 4 is the age
puts p1.inspect # prints elmo (4)
Thursday, June 26, 14
5. Triangle.rb Meetup
June 25th, 2012
Cory Foy | @cory_foy
http://www.coryfoy.com
Ruby and OO
Will It Change Your Life?
Yes!
Ok, Maybe
Its fun to program with
And what is programming if it isnt fun?
Thursday, June 26, 14
6. Triangle.rb Meetup
June 25th, 2012
Cory Foy | @cory_foy
http://www.coryfoy.com
Ruby and OO
Ruby Basics
Variables, Classes and Methods
Properties / Attributes
Exceptions
Access Control
Importing Files and Libraries
Duck Typing
Thursday, June 26, 14
7. Triangle.rb Meetup
June 25th, 2012
Cory Foy | @cory_foy
http://www.coryfoy.com
Ruby and OO
Ruby Basics - Variables
Local (lowercase, underscores)
fred_j = Person.new(Fred)
Instance (@ sign with lowercase)
@name = name
Class (@@ with lowercase)
@@error_email = testing@test.com
Constant (Starts with uppercase)
MY_PI = 3.14
class Move
Global ($ with name)
$MEANING_OF_LIFE = 42
Thursday, June 26, 14
8. Triangle.rb Meetup
June 25th, 2012
Cory Foy | @cory_foy
http://www.coryfoy.com
Ruby and OO
Variables contain
references to objects
Thursday, June 26, 14
9. Triangle.rb Meetup
June 25th, 2012
Cory Foy | @cory_foy
http://www.coryfoy.com
Ruby and OO
Ruby Basics - Classes
Class definitions are started with
class,are named with a CamelCase
name, and ended with end
class Move
attr_accessor :up, :right
def initialize(up, right)
@up = up
@right = right
end
end
Thursday, June 26, 14
10. Triangle.rb Meetup
June 25th, 2012
Cory Foy | @cory_foy
http://www.coryfoy.com
Ruby and OO
Classes (and Modules) are
Objects
Thursday, June 26, 14
11. Triangle.rb Meetup
June 25th, 2012
Cory Foy | @cory_foy
http://www.coryfoy.com
Ruby and OO
Ruby Basics - Classes
Attributes and fields normally go at the
beginning of the class definition
class Move
attr_accessor :up, :right
def initialize(up, right)
@up = up
@right = right
end
end
Thursday, June 26, 14
12. Triangle.rb Meetup
June 25th, 2012
Cory Foy | @cory_foy
http://www.coryfoy.com
Ruby and OO
Ruby Basics - Classes
initialize is the same concept as a
constructor from .NET or Java, and is called
when someone invokes your object using
Move.new to set up the objects state
class Move
attr_accessor :up, :right
def initialize(up, right)
@up = up
@right = right
end
end
Thursday, June 26, 14
13. Triangle.rb Meetup
June 25th, 2012
Cory Foy | @cory_foy
http://www.coryfoy.com
Ruby and OO
Ruby Basics - Methods
Methods return the last expression
evaluated. You can also explicitly return from
methods
class Move
def up
@up
end
def right
return @right
end
end
Thursday, June 26, 14
14. Triangle.rb Meetup
June 25th, 2012
Cory Foy | @cory_foy
http://www.coryfoy.com
Ruby and OO
Every Expression
Evaluates to an Object
Thursday, June 26, 14
15. Triangle.rb Meetup
June 25th, 2012
Cory Foy | @cory_foy
http://www.coryfoy.com
Ruby and OO
Ruby Basics - Methods
Methods can take in specified
parameters, and also parameter lists
(using special notation)
class Move
def initialize(up, right)
@up = up
@right = right
end
end
Thursday, June 26, 14
16. Triangle.rb Meetup
June 25th, 2012
Cory Foy | @cory_foy
http://www.coryfoy.com
Ruby and OO
Its All About Sending
Messages to Objects
Thursday, June 26, 14
17. Triangle.rb Meetup
June 25th, 2012
Cory Foy | @cory_foy
http://www.coryfoy.com
Ruby and OO
Ruby Basics - Methods
Class (Static) methods start with
either self. or Class.
class Move
def self.create
return Move.new
end
def Move.logger
return @@logger
end
end
Thursday, June 26, 14
18. Triangle.rb Meetup
June 25th, 2012
Cory Foy | @cory_foy
http://www.coryfoy.com
Ruby and OO
Ruby Basics - Properties
Ruby supports the concept of
Properties (called Attributes)
class Move
def up
@up
end
end
class Move
def up=(val)
@up = val
end
end
move = Move.new
move.up = 15
puts move.up #15
Thursday, June 26, 14
19. Triangle.rb Meetup
June 25th, 2012
Cory Foy | @cory_foy
http://www.coryfoy.com
Ruby and OO
Ruby Basics - Properties
Ruby also provides convenience
methods for doing this
class Move
attr_accessor :up #Same thing as last slide
end
move = Move.new
move.up = 15
puts move.up #15
Thursday, June 26, 14
20. Triangle.rb Meetup
June 25th, 2012
Cory Foy | @cory_foy
http://www.coryfoy.com
Ruby and OO
Ruby Basics - Properties
You can specify read or write only
attributes as well
class Move
attr_reader :up #Cant write
attr_writer :down #Cant read
end
move = Move.new
move.up = 15 #error
d = move.down #error
Thursday, June 26, 14
21. Triangle.rb Meetup
June 25th, 2012
Cory Foy | @cory_foy
http://www.coryfoy.com
Ruby and OO
Ruby Basics - Exceptions
Ruby has an Exception hierarchy
Exceptions can be caught, raised and
handled
You can also easily retry a block of
code when you encounter an exception
Thursday, June 26, 14
22. Triangle.rb Meetup
June 25th, 2012
Cory Foy | @cory_foy
http://www.coryfoy.com
Ruby and OO
Ruby Basics - Exceptions
process_鍖le = File.open(test鍖le.csv)
begin #put exceptional code in begin/end block
#...process 鍖le
rescue IOError => io_error
puts IOException occurred. Retrying.
retry #starts block over from begin
rescue => other_error
puts Bad stuff happened: + other_error
else #happens if no exceptions occur
puts No errors in processing. Yippee!
ensure # similar to 鍖nally in .NET/Java
process_鍖le.close unless process_鍖le.nil?
end
Thursday, June 26, 14
23. Triangle.rb Meetup
June 25th, 2012
Cory Foy | @cory_foy
http://www.coryfoy.com
Ruby and OO
Ruby Basics Access Control
Ruby supports Public, Protected and
Private methods
Private methods can only be accessed
from the instance of the object, not from
any other object, even those of the
same class as the instance
Thursday, June 26, 14
24. Triangle.rb Meetup
June 25th, 2012
Cory Foy | @cory_foy
http://www.coryfoy.com
Ruby and OO
Ruby Basics Access Control
Access is controlled by using keywords
class Move
private
def calculate_move
end
#Any subsequent methods will be private until..
public
def show_move
end
#Any subsequent methods will now be public
end
Thursday, June 26, 14
25. Triangle.rb Meetup
June 25th, 2012
Cory Foy | @cory_foy
http://www.coryfoy.com
Ruby and OO
Ruby Basics Access Control
Methods can also be passed as args
class Move
def calculate_move
end
def show_move
end
public :show_move
protected :calculate_move
end
Thursday, June 26, 14
26. Triangle.rb Meetup
June 25th, 2012
Cory Foy | @cory_foy
http://www.coryfoy.com
Ruby and OO
Ruby Basics - Imports
To use a class from another file in your
class, you must tell your source file
where to find the class you want to use
require calculator
class Move
def calculate_move
return @up * Calculator::MIN_MOVE
end
end
Thursday, June 26, 14
27. Triangle.rb Meetup
June 25th, 2012
Cory Foy | @cory_foy
http://www.coryfoy.com
Ruby and OO
Ruby Basics - Imports
There are two types of imports
require
Only loads the file once
load
Loads the file every time the method is executed
Both accept relative and absolute paths, and
will search the current load path for the file
Thursday, June 26, 14
28. Triangle.rb Meetup
June 25th, 2012
Cory Foy | @cory_foy
http://www.coryfoy.com
Ruby and OO
Ruby Basics Duck Typing
What defines an object?
How can you tell a car is a car?
By model?
By name?
Or, by its behavior?
Thursday, June 26, 14
29. Triangle.rb Meetup
June 25th, 2012
Cory Foy | @cory_foy
http://www.coryfoy.com
Ruby and OO
Ruby Basics Duck Typing
Wed use static typing! So only the valid
object could be passed in
What if my object has the same
behavior as a Car?
class CarWash
def accept_customer(car)
end
end
How would we
validate this
in .NET or Java?
Thursday, June 26, 14
30. Triangle.rb Meetup
June 25th, 2012
Cory Foy | @cory_foy
http://www.coryfoy.com
Ruby and OO
Ruby Basics Duck Typing
What is
this?
Thursday, June 26, 14
31. Triangle.rb Meetup
June 25th, 2012
Cory Foy | @cory_foy
http://www.coryfoy.com
Ruby and OO
Ruby Basics Duck Typing
How
about
this?
Thursday, June 26, 14
32. Triangle.rb Meetup
June 25th, 2012
Cory Foy | @cory_foy
http://www.coryfoy.com
Ruby and OO
Ruby Basics Duck Typing
What
about
this?
Thursday, June 26, 14
33. Triangle.rb Meetup
June 25th, 2012
Cory Foy | @cory_foy
http://www.coryfoy.com
Ruby and OO
Ruby Basics Duck Typing
We know objects based on the
behaviors and attributes the object
possesses
This means if the object passed in can
act like the object we want, that should
be good enough for us!
Thursday, June 26, 14
34. Triangle.rb Meetup
June 25th, 2012
Cory Foy | @cory_foy
http://www.coryfoy.com
Ruby and OO
Ruby Basics Duck Typing
Or we could just let it fail as a runtime
error
Class CarWash
def accept_customer(car)
if car.respond_to?(:drive_to)
@car = car
wash_car
else
reject_customer
end
end
end
Thursday, June 26, 14
35. Triangle.rb Meetup
June 25th, 2012
Cory Foy | @cory_foy
http://www.coryfoy.com
Ruby and OO
Advanced Ruby - Blocks
A block is just a section of code
between a set of delimters { } or
do..end
{ puts Ho }
3.times do
puts Ho
end #prints Ho Ho Ho
Thursday, June 26, 14
36. Triangle.rb Meetup
June 25th, 2012
Cory Foy | @cory_foy
http://www.coryfoy.com
Ruby and OO
Advanced Ruby - Blocks
Blocks can be associated with method invocations.
The methods call the block using yield
def format_print
puts Con鍖dential. Do Not Disseminate.
yield
puts 息 SomeCorp, 2006
end
format_print { puts My name is Earl! }
-> Con鍖dential. Do Not Disseminate.
-> My name is Earl!
-> 息 SomeCorp, 2006
Thursday, June 26, 14
37. Triangle.rb Meetup
June 25th, 2012
Cory Foy | @cory_foy
http://www.coryfoy.com
Ruby and OO
Advanced Ruby - Blocks
We can check to see if a block was passed to our
method
def MyConnection.open(*args)
conn = Connection.open(*args)
if block_given?
yield conn #passes conn to the block
conn.close #closes conn when block 鍖nishes
end
return conn
end
Thursday, June 26, 14
38. Triangle.rb Meetup
June 25th, 2012
Cory Foy | @cory_foy
http://www.coryfoy.com
Ruby and OO
Advanced Ruby - Iterators
Iterators in Ruby are simply methods
that can invoke a block of code
Iterators typically pass one or more
values to the block to be evaluated
Thursday, June 26, 14
39. Triangle.rb Meetup
June 25th, 2012
Cory Foy | @cory_foy
http://www.coryfoy.com
Ruby and OO
Advanced Ruby - Iterators
def 鍖b_up_to(max)
i1, i2 = 1, 1
while i1 <= max
yield i1
i1, i2 = i2, i1+i2 # parallel assignment
end
end
鍖b_up_to(100) {|f| print f + }
-> 1 1 2 3 5 8 13 21 34 55 89
Pickaxe Book, page 50
Thursday, June 26, 14
40. Triangle.rb Meetup
June 25th, 2012
Cory Foy | @cory_foy
http://www.coryfoy.com
Ruby and OO
Advanced Ruby - Modules
At their core, Modules are like
namespaces in .NET or Java.
module Kite
def Kite.鍖y
end
end
module Plane
def Plane.鍖y
end
end
Thursday, June 26, 14
41. Triangle.rb Meetup
June 25th, 2012
Cory Foy | @cory_foy
http://www.coryfoy.com
Ruby and OO
Advanced Ruby - Mixins
Modules cant have instances they
arent classes
But Modules can be included in
classes, who inherit all of the instance
method definitions from the module
This is called a mixin and is how Ruby
does Multiple Inheritance
Thursday, June 26, 14
42. Triangle.rb Meetup
June 25th, 2012
Cory Foy | @cory_foy
http://www.coryfoy.com
Ruby and OO
Advanced Ruby - Mixins
module Print
def print
puts Company Con鍖dential
yield
end
end
class Document
include Print
#...
end
doc = Document.new
doc.print { Fourth Quarter looks great! }
-> Company Con鍖dential
-> Fourth Quarter looks great!
Thursday, June 26, 14
43. Triangle.rb Meetup
June 25th, 2012
Cory Foy | @cory_foy
http://www.coryfoy.com
Ruby and OO
Advanced Ruby - Reflection
How could we call the Length of a
String at runtime in .NET?
String myString = "test";
int len = (int)myString
.GetType()
.InvokeMember("Length",
System.Re鍖ection.BindingFlags.GetProperty,
null, myString, null);
Console.WriteLine("Length: " + len.ToString());
Thursday, June 26, 14
44. Triangle.rb Meetup
June 25th, 2012
Cory Foy | @cory_foy
http://www.coryfoy.com
Ruby and OO
Advanced Ruby - Reflection
In Ruby, we can just send the
command to the object
myString = Test
puts myString.send(:length) # 4
Thursday, June 26, 14
45. Triangle.rb Meetup
June 25th, 2012
Cory Foy | @cory_foy
http://www.coryfoy.com
Ruby and OO
Advanced Ruby - Reflection
We can also do all kinds of fancy stuff
#print out all of the objects in our system
ObjectSpace.each_object(Class) {|c| puts c}
#Get all the methods on an object
Some String.methods
#see if an object responds to a certain method
obj.respond_to?(:length)
#see if an object is a type
obj.kind_of?(Numeric)
obj.instance_of?(FixNum)
Thursday, June 26, 14
46. Triangle.rb Meetup
June 25th, 2012
Cory Foy | @cory_foy
http://www.coryfoy.com
Ruby and OO
Sending Can Be Very, Very
Bad
Thursday, June 26, 14
47. Triangle.rb Meetup
June 25th, 2012
Cory Foy | @cory_foy
http://www.coryfoy.com
Ruby and OO
Ruby Basics Other Goodies
RubyGems Package Management for
Ruby Libraries
Rake A Pure Ruby build tool (can use
XML as well for the build files)
RDoc Automatically extracts
documentation from your code and
comments
Thursday, June 26, 14
48. Triangle.rb Meetup
June 25th, 2012
Cory Foy | @cory_foy
http://www.coryfoy.com
Ruby and OO
Ruby Resources
Programming Ruby by Dave Thomas (the
Pickaxe Book)
http://www.ruby-lang.org
http://www.rubycentral.org
http://www.ruby-doc.org
http://www.triangleruby.com
http://www.manning.com/black3/
http://www.slideshare.net/dablack/wgnuby
Thursday, June 26, 14