Master Ruby and object-oriented design in this advanced course built for developers who are ready to take their programming expertise to the next level. Through 15 in-depth modules, you’ll move beyond the basics to write clean, reusable, and maintainable code while developing the skills to build and scale complex Ruby applications.
通过 Coursera Plus 提高技能,仅需 239 美元/年(原价 399 美元)。立即节省

Advanced Ruby Programming and Object-Oriented Design
本课程是 Learn to Code with Ruby 专项课程 的一部分
包含在 中
了解更多
推荐体验
推荐体验
高级
This course is aimed at experienced Ruby developers and want to deepen their understanding of advanced concepts and object-oriented design.
推荐体验
推荐体验
高级
This course is aimed at experienced Ruby developers and want to deepen their understanding of advanced concepts and object-oriented design.
您将学到什么
Analyze and evaluate the use of blocks, procs, and lambdas to write flexible and reusable code.
Design and create complex class hierarchies and object-oriented structures.
Utilize and implement advanced inheritance techniques and the super keyword in Ruby programming.
Handle and manage file operations, sets, and date/time manipulations effectively.
要了解的详细信息

添加到您的领英档案
7 项作业
了解顶级公司的员工如何掌握热门技能

积累特定领域的专业知识
- 向行业专家学习新概念
- 获得对主题或工具的基础理解
- 通过实践项目培养工作相关技能
- 获得可共享的职业证书

该课程共有15个模块
In this module, we will delve into the advanced functionalities of blocks, Procs, and lambdas in Ruby. You will learn how to implement and utilize these features to create flexible, reusable, and efficient code. We'll cover key concepts such as the 'yield' keyword, block parameters, and methods with Proc parameters, and provide detailed comparisons between Procs and lambdas. By the end of this section, you'll have a comprehensive understanding of these powerful Ruby tools.
涵盖的内容
12个视频2篇阅读材料
12个视频•总计115分钟
- Review of Blocks•5分钟
- The yield Keyword•5分钟
- Block Return Values•5分钟
- The block_given? Method•4分钟
- Block Parameters•10分钟
- A Custom each Method•11分钟
- Procs•11分钟
- More Proc Examples•9分钟
- Methods with Proc Parameters•18分钟
- Intro to Lambdas•8分钟
- Differences between Lambdas and Procs•15分钟
- Section Review [SLIDES]•13分钟
2篇阅读材料•总计20分钟
- Introduction to the Course 'Advanced Ruby Programming and Object-Oriented Design'•10分钟
- Full Specialization Resources•10分钟
In this module, we will explore the fundamental principles of object-oriented programming in Ruby by examining classes and objects. You will learn how to define classes, create and use instance variables, and write instance methods to encapsulate functionality. We'll also cover the 'self' keyword, getter and setter methods, and Ruby's shorthand syntax for accessors. By the end of this section, you'll have a solid understanding of how to create and manipulate objects using Ruby classes, setting the foundation for more advanced topics in object-oriented design.
涵盖的内容
14个视频
14个视频•总计126分钟
- Intro to Classes•15分钟
- Create a Class•8分钟
- The new Method on Ruby's Native Objects•3分钟
- Instance Variables and the initialize Method•17分钟
- Instance Methods•13分钟
- Override the to_s Method•7分钟
- The self Keyword•11分钟
- Omitting the self Keyword•11分钟
- Getter Methods (Read Methods)•6分钟
- Setter Methods (Write Methods)•9分钟
- The attr_reader and attr_writer Methods•6分钟
- The attr_accessor Method•2分钟
- Add Parameters to initialize Method•8分钟
- Section Review [SLIDES]•10分钟
In this module, we will delve deeper into the advanced aspects of Ruby classes. You will learn how to encapsulate class internals with private and protected methods, ensuring controlled access to class functionality. We'll cover how to add validation to setter methods and compute derived values dynamically. Additionally, you'll explore class methods, alternative syntaxes for defining them, and class variables for shared state management. The concept of monkey patching will be introduced, allowing you to extend existing classes with new functionality. This section concludes with a comprehensive review to solidify your understanding of these advanced class concepts.
涵盖的内容
10个视频1个作业
10个视频•总计87分钟
- Private Methods•9分钟
- Protected Methods•12分钟
- Add Validation to Setter Methods•8分钟
- Derived Values•8分钟
- Class Methods•12分钟
- Alternative Class Method Syntax•6分钟
- Class Variables•8分钟
- Building a Class Over Time•7分钟
- Monkey Patching•10分钟
- Section Review [SLIDES]•8分钟
1个作业•总计15分钟
- Assessment 1•15分钟
In this module, we will explore the robust feature of keyword arguments in Ruby. You'll learn how to use hashes as initialization arguments to make your methods more flexible and efficient. We'll cover the implementation of required and optional keyword arguments, ensuring your methods can handle varying input needs gracefully. Additionally, we’ll examine the interplay between positional and keyword arguments, providing insights into their effective combination. Through a practical refactoring of the Candidate class, you'll see how keyword arguments can simplify and enhance object initialization. This section concludes with a thorough review to reinforce your understanding of keyword arguments and their benefits.
涵盖的内容
6个视频
6个视频•总计42分钟
- Hash as initialize Argument•13分钟
- Required Keyword Arguments•10分钟
- Optional Keyword Arguments•4分钟
- Positional Arguments and Keyword Arguments•5分钟
- New Version of Candidate Class with Keyword Arguments•5分钟
- Section Review [SLIDES]•4分钟
In this module, we will delve into the powerful concept of inheritance in Ruby. You'll learn to create and manage superclasses and subclasses, understanding the hierarchical relationships that shape object functionality. We'll explore key methods such as 'superclass', 'ancestors', 'is_a?', and 'instance_of?' to trace and verify inheritance hierarchies. You’ll also learn to define exclusive methods in subclasses and override superclass methods. The 'super' keyword will be covered in-depth, along with techniques for defining object equality and leveraging duck typing for dynamic programming. This section concludes with a comprehensive review of all inheritance concepts discussed.
涵盖的内容
13个视频
13个视频•总计115分钟
- Intro to Inheritance [SLIDES]•6分钟
- Create Subclasses•9分钟
- The superclass and ancestors Class Methods•10分钟
- Check Inheritance Hierarchy of our Subclasses•8分钟
- The is_a? and instance_of? Methods•5分钟
- The methods Method•8分钟
- Exclusive Instance Methods in Subclasses•5分钟
- Override Methods in a Subclass•9分钟
- The super Keyword I•13分钟
- The super Keyword II•11分钟
- Defining Equality•8分钟
- Duck Typing•13分钟
- Section Review [SLIDES]•10分钟
In this module, we will explore various methods for handling input and output operations in Ruby. You'll learn to read from and write to text files, and how to rename and delete files while ensuring their existence. We will also cover how to pass and use command-line arguments via the ARGV array. The module includes a detailed explanation of loading and importing Ruby files using the 'load', 'require', and 'require_relative' methods, highlighting the differences and best practices for each. This section concludes with a comprehensive review to reinforce your understanding of Ruby's file handling and input/output capabilities.
涵盖的内容
7个视频1个作业
7个视频•总计57分钟
- Read from a Text File•7分钟
- Write to a Text File•10分钟
- Rename and Delete a File•5分钟
- Command Line Arguments (ARGV)•7分钟
- Load A Ruby File with load Method•10分钟
- The require and require_relative Methods•11分钟
- Section Review [SLIDES]•8分钟
1个作业•总计15分钟
- Assessment 2•15分钟
In this module, we will explore the powerful concept of modules and mixins in Ruby. You'll learn to define modules with constants and methods, and how to manage multiple modules with identical methods using protected namespaces. We'll cover importing modules into files and utilizing built-in modules like Math, URI, and Net/HTTP. The module will introduce mixins, showcasing how to add methods from modules like Enumerable and Comparable to classes. You'll learn to mix in custom modules, use the 'prepend' and 'extend' keywords, and handle multiple module declarations and nesting within modules. This section concludes with a comprehensive review to solidify your understanding of modules and mixins in Ruby.
涵盖的内容
15个视频
15个视频•总计131分钟
- Intro to Modules•11分钟
- Modules with Identical Methods•5分钟
- Import Modules into the Current File•5分钟
- The Math Module•6分钟
- The uri and net/http Modules•11分钟
- The Enumerable Mixin•25分钟
- The Comparable Mixin•16分钟
- Mixing in Our Own Module•8分钟
- The ancestors Method in Depth•7分钟
- The prepend Keyword•4分钟
- The extend Keyword•5分钟
- Mixing in Multiple Modules•4分钟
- Multiple Declarations for the Same Module•7分钟
- Modules within Modules•9分钟
- Section Review [SLIDES]•10分钟
In this module, we will delve into the Set data structure in Ruby. You will learn about its properties as a mutable, unordered collection that ensures element uniqueness. We will cover methods to add and delete elements, examining how these methods behave based on the presence or absence of elements within the Set. Additionally, we will explore the Set class's source code on GitHub to gain insights into its implementation. This section concludes with a review to reinforce your understanding of Sets and their practical applications in Ruby programming.
涵盖的内容
4个视频
4个视频•总计16分钟
- Intro to Sets•6分钟
- Add and Delete Items from Set•3分钟
- Explore set.rb on GitHub•4分钟
- Section Review [SLIDES]•3分钟
In this module, we will explore the handling of dates and times in Ruby using the Date and Time objects. You will learn to instantiate these objects, perform arithmetic operations to add or subtract time, and compare Time objects using the Comparable module. We'll cover formatting Time objects into strings with the 'strftime' method and parsing strings into Time objects using the 'parse' and 'strptime' methods. This section concludes with a comprehensive review to ensure a solid understanding of managing date and time representations in Ruby for various applications.
涵盖的内容
7个视频1个作业
7个视频•总计49分钟
- The Date Object•6分钟
- The Time Object•8分钟
- Add or Subtract Time•5分钟
- The Comparable Methods on a Time Object•5分钟
- Convert Time Object to Formatted String•7分钟
- The parse and strptime Methods•11分钟
- Section Review [SLIDES]•6分钟
1个作业•总计15分钟
- Assessment 3•15分钟
In this module, we will delve into the powerful tool of regular expressions in Ruby. You'll learn the basics of creating 'Regexp' objects and using simple search methods. We'll explore the 'scan' method to find all matches in a string and practice using symbols like '\d' for digits, '.' for wildcards, and more for custom pattern matching. Anchors and exclusion techniques will be covered to refine your searches. Additionally, we'll learn to use the 'sub' and 'gsub' methods for find-and-replace operations. This section concludes with a review and an introduction to Rubular.com, a helpful resource for experimenting with regular expressions.
涵盖的内容
9个视频
9个视频•总计58分钟
- Intro to Regular Expressions•9分钟
- The scan Method•5分钟
- The Digit Symbol•9分钟
- The Wildcard Symbol•9分钟
- Anchors•5分钟
- Exclude Characters•5分钟
- The sub and gsub Methods with Regular Expressions•8分钟
- Rubular.com•3分钟
- Section Review [SLIDES]•5分钟
In this module, we will explore exception handling in Ruby to manage and respond to errors effectively. You'll learn to use the 'begin' and 'rescue' keywords to define and handle error-prone sections of code. We'll cover capturing error objects with the '=> e' syntax and using multiple rescue clauses for different error types. The 'retry' keyword will be introduced to reattempt code execution, while the 'ensure' keyword will be used for clean-up actions. We'll also discuss how to manually raise exceptions with the 'raise' keyword and define custom error classes for specific error handling. This section concludes with a review to reinforce your understanding of exception handling in Ruby.
涵盖的内容
8个视频
8个视频•总计71分钟
- The begin and rescue Keywords•11分钟
- Catching Error Object•9分钟
- The retry Keyword•7分钟
- The ensure Keyword•4分钟
- Using begin and rescue at Top Level•9分钟
- The raise Keyword•9分钟
- Custom Exceptions•11分钟
- Section Review [SLIDES]•10分钟
In this module, we will immerse ourselves in testing Ruby code using the Minitest framework. Starting with the basics, you'll learn to import the 'minitest/autorun' module, declare test classes, and use common assertions like 'assert_equal'. We'll then test a simple class to put these concepts into practice. You'll learn to set up and tear down test environments using the 'setup' and 'teardown' methods, and validate code behavior with assertions such as 'assert_includes' and 'assert_raises'. Additionally, we will cover how to enhance test messages with custom strings. This section concludes with a comprehensive review of Minitest features and practices to solidify your understanding of testing in Ruby.
涵盖的内容
7个视频1个作业
7个视频•总计71分钟
- Intro to Testing•17分钟
- Testing a Class•10分钟
- The setup and teardown Methods•12分钟
- Assert Inclusion•7分钟
- Assert Error was Raised•9分钟
- Final Argument to Assertion Methods•6分钟
- Section Review [SLIDES]•10分钟
1个作业•总计15分钟
- Assessment 4•15分钟
In this module, we will focus on reading and writing documentation in Ruby. You will learn to navigate the official Ruby documentation, searching for classes and methods while understanding the distinction between class methods ('::') and instance methods ('#'). We'll cover using RDoc to generate webpage documentation for Ruby projects, showing how regular comments can be used to annotate code effectively. By mastering these skills, you'll enhance your ability to document and understand Ruby projects, making your code more maintainable and accessible to others.
涵盖的内容
2个视频
2个视频•总计19分钟
- Reading Documentation•9分钟
- Use RDoc to Generate Documentation•10分钟
In this module, we will explore the world of Ruby Gems, which are pre-written code bundles that can enhance your projects. You'll learn to navigate RubyGems, update the gem program, and install Gems using both 'gem install' and 'bundle install' commands. We'll cover managing project dependencies through a Gemfile to maintain consistency across development environments. Finally, we'll practice using the Faker Gem to generate random data, demonstrating the practical integration of gems into Ruby projects. By the end of this section, you'll be proficient in leveraging gems to add functionality and streamline your Ruby development process.
涵盖的内容
4个视频1个作业
4个视频•总计45分钟
- Intro to Ruby Gems•18分钟
- Updating Gem Program•3分钟
- Installing Faker Gem•16分钟
- Use Faker Gem•8分钟
1个作业•总计15分钟
- Assessment 5•15分钟
In this final module, we will celebrate the completion of the Advanced Ruby Programming and Object-Oriented Design course. We'll wrap up by summarizing the key learnings and achievements throughout the course. Reflect on the skills acquired, including advanced Ruby techniques, object-oriented design principles, and practical applications. This session provides an opportunity to acknowledge your progress and consider how to apply your new knowledge to future Ruby programming projects.
涵盖的内容
1个视频1篇阅读材料2个作业
1个视频•总计2分钟
- Conclusion to the Specialization•2分钟
1篇阅读材料•总计10分钟
- Conclusion to the Course 'Advanced Ruby Programming and Object-Oriented Design'•10分钟
2个作业•总计75分钟
- Full Course Assessment•60分钟
- Full Course Practice Assessment•15分钟
获得职业证书
将此证书添加到您的 LinkedIn 个人资料、简历或履历中。在社交媒体和绩效考核中分享。
位教师

提供方

提供方

Packt helps tech professionals put software to work by distilling and sharing the working knowledge of their peers. Packt is an established global technical learning content provider, founded in Birmingham, UK, with over twenty years of experience delivering premium, rich content from groundbreaking authors on a wide range of emerging and popular technologies.
从 Software Development 浏览更多内容
人们为什么选择 Coursera 来帮助自己实现职业发展

Felipe M.

Jennifer J.

Larry W.

Chaitanya A.
常见问题
Yes, you can preview the first video and view the syllabus before you enroll. You must purchase the course to access content not included in the preview.
If you decide to enroll in the course before the session start date, you will have access to all of the lecture videos and readings for the course. You’ll be able to submit assignments once the session starts.
Once you enroll and your session begins, you will have access to all videos and other resources, including reading items and the course discussion forum. You’ll be able to view and submit practice assessments, and complete required graded assignments to earn a grade and a Course Certificate.
If you complete the course successfully, your electronic Course Certificate will be added to your Accomplishments page - from there, you can print your Course Certificate or add it to your LinkedIn profile.
This course is currently available only to learners who have paid or received financial aid, when available.
Yes. In select learning programs, you can apply for financial aid or a scholarship if you can’t afford the enrollment fee. If fin aid or scholarship is available for your learning program selection, you’ll find a link to apply on the description page.
更多问题
提供助学金,



