万本电子书0元读

万本电子书0元读

顶部广告

Comprehensive Ruby Programming电子书

售       价:¥

4人正在读 | 0人评论 9.8

作       者:Jordan Hudgens

出  版  社:Packt Publishing

出版时间:2017-07-07

字       数:29.5万

所属分类: 进口书 > 外文原版书 > 电脑/网络

温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印

为你推荐

  • 读书简介
  • 目录
  • 累计评论(0条)
  • 读书简介
  • 目录
  • 累计评论(0条)
This book will provide you with all of the tools you need to be a professional Ruby developer. Starting with the core principles, such as syntax and best practices, and up to advanced topics like metaprogramming and big data analysis. About This Book ? Provides the core skills required to become a Ruby programmer ? Covers how to use the most popular Ruby Gem libraries ? Includes details on regular expressions Who This Book Is For This is a complete course written from the ground up for beginners wanting to gain a solid understanding of the Ruby language. It starts at the beginning with how to install Ruby and work with it on multiple machines, so simply have a computer that's connected to the Internet and you'll be ready. What You Will Learn ? Learn how to use Ruby code effectively, picking the right tool for the job and not duplicating built-in functionality ? Gain best software development practices, and how to identify and fix common errors ? Absorb core programming skills, such as variables, strings, loops, conditionals, and much more ? Explore object-oriented programming and learn to create modular, reusable code that you can use across projects ? Build 10 practical Ruby programs as you work through the book on topics such as big data analysis and solving Euler equations In Detail Ruby is a powerful, general-purpose programming language that can be applied to any task. Whether you are an experienced developer who wants to learn a new language or you are new to programming, this book is your comprehensive Ruby coding guide. Starting with the foundational principles, such as syntax, and scaling up to advanced topics such as big data analysis, this book will give you all of the tools you need to be a professional Ruby developer. A few of the key topics are: object-oriented programming, built-in Ruby methods, core programming skills, and an introduction to the Ruby on Rails and Sinatra web frameworks. You will also build 10 practical Ruby programs. Created by an experienced Ruby developer, this book has been written to ensure it focuses on the skills you will need to be a professional Ruby developer. After you have read this book, you will be ready to start building real-world Ruby projects. Style and approach This is a comprehensive course for learning the Ruby programming language that works methodically through everything that you need to know. It begins with the basics of the language and then works through some complete projects to apply your skills and ensure that you have fully absorbed them and can use them in the real world.
目录展开

Title Page

Copyright

Comprehensive Ruby Programming

Credits

About the Author

www.PacktPub.com

Why subscribe?

Customer Feedback

Preface

What this book covers

What you need for this book

Who this book is for

Conventions

Reader feedback

Customer support

Downloading the example code

Downloading the color images of this book

Errata

Piracy

Questions

Introduction to the Ruby Programming Language

What is Ruby?

Popular sites that use Ruby

Installing Ruby on a computer

Ruby language dashboard

Installing different Ruby versions with RVM

Summary

Ruby Variables

Using variables in Ruby

Variable code implementation

Printing to the Ruby console

Using puts

Using p

Getting input from the Ruby console using gets and chomp

Code implementation

Variable scope and variable types

Local variables

Global variables

Instance variables

Constants

Class variables

Summary

Ruby Strings

Using strings in Ruby

Missing quotation marks

Printing strings

Storing strings in variables

String interpolation guide for Ruby

What is string interpolation?

String manipulation guide

What is string manipulation?

String manipulation code examples

Method chaining

A practical implementation

Give it a bang!

String substitution guide

Adding a bang

Becoming a block head

Split, strip, and join guides for strings

Using the strip method

Using the split method

Using the join method

Summary

Working with Numbers in Ruby

Integer arithmetic guide

Arithmetic order of operations

Difference between integers and floats

Summary

Ruby Methods

Creating methods in Ruby

What does a Ruby method return?

What are the differences between class and instance methods in Ruby?

Ruby proc tutorial

Proc code example

What is a block?

The Ruby lambda tutorial

Stabby lambdas

What is the difference between procs and lambdas in Ruby?

Argument count

Return behavior

Guide to method arguments in Ruby

What are method arguments?

Method argument syntax

Method argument code examples

Named arguments

Default argument values

Using splat and optional arguments in Ruby methods

Traditional splat arguments

Keyword-based splat arguments

Optional arguments

Summary

Ruby Iterators and Loops

The while loop guide

The while loop code example

The each iterator method tutorial

The each loop code example

The for...in loops tutorial

Looping over a hash

Nested iterator code example

Using the select method

Using the map method – part 1

The map method code example

Using the map method – part 2

Summing values in an array using the inject method

Summary

Ruby Collections

Using arrays

Deleting items from arrays

Using push and pop for arrays

The Ruby hash tutorial

The hash code example

Deleting elements from a hash

Iterating over a hash for a key or value

Top hash methods in Ruby

Adding elements to a hash

Swapping keys and values

Merging hashes

Converting a hash into an array

Listing all keys

Listing all values

Summary

Ruby Conditionals

The conditionals guide

Real-world use of conditionals

Code example of conditionals

Syntax for the unless conditional

Running Ruby files

The unless conditional code example

Nested if...else conditionals

The if...elsif conditional code example

The conditional workflow

Guide to compound conditionals

Compound conditionals code example

Compounded compound conditionals

Additional conditional operators

Summary

Object-Oriented Programming in Ruby

Introduction to how OOP works

A real-world OOP example

Ruby OOP development – setters, getters, and methods

Working with instantiation in Ruby

What does instantiation mean? – A real-world example

Connecting the dots

Instantiation code example

Implementing instantiation

Creating an initializer method in a Ruby class

Adding an initializer to a Ruby class

Working with optional values

Using named arguments

Overriding default values

The working of OOP inheritance

Overview of private versus public methods

Private versus public methods

Private method code example

The working of polymorphism and usage of super

So how does polymorphism fit in?

Dead simple OOP

My history with OOP

How does OOP work?

SOLID OOP development – the simple responsibility principle

The single responsibility principle

The SRP in the real world

An SRP example

The class that knew too much

Rule of thumb – no ands allowed

A mailer class

The sales tax class

Why the SRP is important

SOLID OOP development – the open/closed principle guide and example

The open/closed principle definition

A surprisingly challenging task

The open/closed principle example

The naive approach

I don't like change!

A better way

SOLID OOP development – the Liskov substitution principle

The LSP definition

Breaking down the LSP

The LSP example

The problem

The LSP violation

The fix

SOLID OOP development – the interface segregation principle

The ISP definition

The ISP code example

Introducing the moderator

A better way

The result

A caveat

SOLID OOP development – the dependency inversion principle

The DIP in the real world

The DIP definition

The DIP code example

Recap

Summary

Working with the Filesystem in Ruby

Creating a file

Ruby File class

Other options you can pass as the second option

Reading files into a program using the File class

Deleting a file

Appending a file

Building a log file

Summary

Error Handling in Ruby

Error handling tutorial

Error handling – the best practices

Developing a custom error logger in Ruby

Summary

Regular Expressions in Ruby

Regular expression code example

Regex code example

How to validate an IP address using regular expressions

How to develop a wheel of fortune game

Summary

Searching with grep in Ruby

How to use grep in Ruby

How to use grep instead of the select and map methods

Summary

Ruby Gems

Introduction to Ruby gems

How to research Ruby gems

How to research gems

Summary

Ruby Metaprogramming

Metaprogramming introduction

How to integrate metaprogramming techniques into a custom class

How to use metaprogramming for opening and customizing the String class

How Rails use metaprogramming for the find_by method

Utilizing metaprogramming with method_missing to create methods on the fly

Why do we need to call super?

Resources

Incorporating respond_to_missing to conform to metaprogramming best practices

Resources

Implementing metaprogramming with define_method

Resources

Summary

Ruby Web Frameworks

Sinatra web framework development

Introduction to the Ruby on Rails framework

Summary

Working with APIs in Ruby

How to work with APIs in Ruby

How to use the httparty Ruby gem

How to create a custom API connector in Ruby

How to parse an API in Ruby

Summary

Ruby Algorithms

Introduction to sorting algorithms

Bubble sort

Quick sort

Merge sort

Implementing the bubble sort algorithm

Bubble sort code example

Implementing the quick sort algorithm

Explanation of quick sort

Quick sort code example

Implementing the merge sort algorithm

Implementing a prime number counting algorithm

How to code the power digit sum algorithm

Implementing a humanize counting algorithm

Implementing a date algorithm

How to code a Fibonacci digit counter

Implementing a permutation algorithm

Implementing an amicable number algorithm

Implementing a factorial algorithm

Implementing an even Fibonacci number algorithm

Implementing the least common multiple

Summary

Machine Learning

Big data analysis

Basic decision tree implementation

Addition of attributes

Addition of training data and its values

Calling the ID3 method

Function of the train method

Addition of the test method

Setting up decision variables

Print the results out

Testing the program

Advantage of decision trees over if...else statements

How to develop a big data analysis application in Ruby

Summary

累计评论(0条) 0个书友正在讨论这本书 发表评论

发表评论

发表评论,分享你的想法吧!

买过这本书的人还买过

读了这本书的人还在读

回顶部