Ruby Notes for Professionals book

    Amazing collection of free programming books

    收集中
    免费
    Amazing collection of free programming books

    The Notes for Professionals book is compiled from Stack Overflow Documentation, the content is written by the beautiful people at Stack Overflow. Text content is released under Creative Commons BY-SA. See credits at the end of this book whom contributed to the various chapters. Images may be copyright of their respective owners unless otherwise specified

    Book created for educational purposes and is not affiliated with group(s), company(s) nor Stack Overflow. All trademarks belong to their respective company owners

    https://goalkicker.com/

    章节目录

    1-1Content list
    1-2About
    1-3Chapter 1: Getting started with Ruby Language
    1-4Section 1.1: Hello World
    1-5Section 1.2: Hello World as a Self-Executable File—using Shebang (Unix-like operating systems only)
    1-6Section 1.3: Hello World from IRB
    1-7Section 1.4: Hello World without source files
    1-8Section 1.5: Hello World with tk
    1-9Section 1.6: My First Method
    1-10Chapter 2: Casting (type conversion)
    1-11Section 2.1: Casting to a Float
    1-12Section 2.2: Casting to a String
    1-13Section 2.3: Casting to an Integer
    1-14Section 2.4: Floats and Integers
    1-15Chapter 3: Operators
    1-16Section 3.1: Operator Precedence and Methods
    1-17Section 3.2: Case equality operator (===)
    1-18Section 3.3: Safe Navigation Operator
    1-19Section 3.4: Assignment Operators
    1-20Section 3.5: Comparison Operators
    1-21Chapter 4: Variable Scope and Visibility
    1-22Section 4.1: Class Variables
    1-23Section 4.2: Local Variables
    1-24Section 4.3: Global Variables
    1-25Section 4.4: Instance Variables
    1-26Chapter 5: Environment Variables
    1-27Section 5.1: Sample to get user profile path
    1-28Chapter 6: Constants
    1-29Section 6.1: Define a constant
    1-30Section 6.2: Modify a Constant
    1-31Section 6.3: Constants cannot be defined in methods
    1-32Section 6.4: Define and change constants in a class
    1-33Chapter 7: Special Constants in Ruby
    1-34Section 7.1: __FILE__
    1-35Section 7.2: __dir__
    1-36Section 7.3: $PROGRAM_NAME or $0
    1-37Section 7.4: $$
    1-38Section 7.5: $1, $2, etc
    1-39Section 7.6: ARGV or $*
    1-40Section 7.7: STDIN
    1-41Section 7.8: STDOUT
    1-42Section 7.9: STDERR
    1-43Section 7.10: $stderr
    1-44Section 7.11: $stdout
    1-45Section 7.12: $stdin
    1-46Section 7.13: ENV
    1-47Chapter 8: Comments
    1-48Section 8.1: Single & Multiple line comments
    1-49Chapter 9: Arrays
    1-50Section 9.1: Create Array of Strings
    1-51Section 9.2: Create Array with Array::new
    1-52Section 9.3: Create Array of Symbols
    1-53Section 9.4: Manipulating Array Elements
    1-54Section 9.5: Accessing elements
    1-55Section 9.6: Creating an Array with the literal constructor [ ]
    1-56Section 9.7: Decomposition
    1-57Section 9.8: Arrays union, intersection and dierence
    1-58Section 9.9: Remove all nil elements from an array with #compact
    1-59Section 9.10: Get all combinations / permutations of an array
    1-60Section 9.11: Inject, reduce
    1-61Section 9.12: Filtering arrays
    1-62Section 9.13: #map
    1-63Section 9.14: Arrays and the splat (*) operator
    1-64Section 9.15: Two-dimensional array
    1-65Section 9.16: Turn multi-dimensional array into a one-dimensional (flattened) array
    1-66Section 9.17: Get unique array elements
    1-67Section 9.18: Create Array of numbers
    1-68Section 9.19: Create an Array of consecutive numbers or letters
    1-69Section 9.20: Cast to Array from any object
    1-70Chapter 10: Multidimensional Arrays
    1-71Section 10.1: Initializing a 2D array
    1-72Section 10.2: Initializing a 3D array
    1-73Section 10.3: Accessing a nested array
    1-74Section 10.4: Array flattening
    1-75Chapter 11: Strings
    1-76Section 11.1: Dierence between single-quoted and double-quoted String literals
    1-77Section 11.2: Creating a String
    1-78Section 11.3: Case manipulation
    1-79Section 11.4: String concatenation
    1-80Section 11.5: Positioning strings
    1-81Section 11.6: Splitting a String
    1-82Section 11.7: String starts with
    1-83Section 11.8: Joining Strings
    1-84Section 11.9: String interpolation
    1-85Section 11.10: String ends with
    1-86Section 11.11: Formatted strings
    1-87Section 11.12: String Substitution
    1-88Section 11.13: Multiline strings
    1-89Section 11.14: String character replacements
    1-90Section 11.15: Understanding the data in a string
    1-91Chapter 12: DateTime
    1-92Section 12.1: DateTime from string
    1-93Section 12.2: New
    1-94Section 12.3: Add/subtract days to DateTime
    1-95Chapter 13: Time
    1-96Section 13.1: How to use the strftime method
    1-97Section 13.2: Creating time objects
    1-98Chapter 14: Numbers
    1-99Section 14.1: Converting a String to Integer
    1-100Section 14.2: Creating an Integer
    1-101Section 14.3: Rounding Numbers
    1-102Section 14.4: Even and Odd Numbers
    1-103Section 14.5: Rational Numbers
    1-104Section 14.6: Complex Numbers
    1-105Section 14.7: Converting a number to a string
    1-106Section 14.8: Dividing two numbers
    1-107Chapter 15: Symbols
    1-108Section 15.1: Creating a Symbol
    1-109Section 15.2: Converting a String to Symbol
    1-110Section 15.3: Converting a Symbol to String
    1-111Chapter 16: Comparable
    1-112Section 16.1: Rectangle comparable by area
    1-113Chapter 17: Control Flow
    1-114Section 17.1: if, elsif, else and end
    1-115Section 17.2: Case statement
    1-116Section 17.3: Truthy and Falsy values
    1-117Section 17.4: Inline if/unless
    1-118Section 17.5: while, until
    1-119Section 17.6: Flip-Flop operator
    1-120Section 17.7: Or-Equals/Conditional assignment operator (||=)
    1-121Section 17.8: unless
    1-122Section 17.9: throw, catch
    1-123Section 17.10: Ternary operator
    1-124Section 17.11: Loop control with break, next, and redo
    1-125Section 17.12: return vs. next: non-local return in a block
    1-126Section 17.13: begin, end
    1-127Section 17.14: Control flow with logic statements
    1-128Chapter 18: Methods
    1-129Section 18.1: Defining a method
    1-130Section 18.2: Yielding to blocks
    1-131Section 18.3: Default parameters
    1-132Section 18.4: Optional parameter(s) (splat operator)
    1-133Section 18.5: Required default optional parameter mix
    1-134Section 18.6: Use a function as a block
    1-135Section 18.7: Single required parameter
    1-136Section 18.8: Tuple Arguments
    1-137Section 18.9: Capturing undeclared keyword arguments (double splat)
    1-138Section 18.10: Multiple required parameters
    1-139Section 18.11: Method Definitions are Expressions
    1-140Chapter 19: Hashes
    1-141Section 19.1: Creating a hash
    1-142Section 19.2: Setting Default Values
    1-143Section 19.3: Accessing Values
    1-144Section 19.4: Automatically creating a Deep Hash
    1-145Section 19.5: Iterating Over a Hash
    1-146Section 19.6: Filtering hashes
    1-147Section 19.7: Conversion to and from Arrays
    1-148Section 19.8: Overriding hash function
    1-149Section 19.9: Getting all keys or values of hash
    1-150Section 19.10: Modifying keys and values
    1-151Section 19.11: Set Operations on Hashes
    1-152Chapter 20: Blocks and Procs and Lambdas
    1-153Section 20.1: Lambdas
    1-154Section 20.2: Partial Application and Currying
    1-155Section 20.3: Objects as block arguments to methods
    1-156Section 20.4: Converting to Proc
    1-157Section 20.5: Blocks
    1-158Chapter 21: Iteration
    1-159Section 21.1: Each
    1-160Section 21.2: Implementation in a class
    1-161Section 21.3: Iterating over complex objects
    1-162Section 21.4: For iterator
    1-163Section 21.5: Iteration with index
    1-164Section 21.6: Map
    1-165Chapter 22: Exceptions
    1-166Section 22.1: Creating a custom exception type
    1-167Section 22.2: Handling multiple exceptions
    1-168Section 22.3: Handling an exception
    1-169Section 22.4: Raising an exception
    1-170Section 22.5: Adding information to (custom) exceptions
    1-171Chapter 23: Enumerators
    1-172Section 23.1: Custom enumerators
    1-173Section 23.2: Existing methods
    1-174Section 23.3: Rewinding
    1-175Chapter 24: Enumerable in Ruby
    1-176Section 24.1: Enumerable module
    1-177Chapter 25: Classes
    1-178Section 25.1: Constructor
    1-179Section 25.2: Creating a class
    1-180Section 25.3: Access Levels
    1-181Section 25.4: Class Methods types
    1-182Section 25.5: Accessing instance variables with getters and setters
    1-183Section 25.6: New, allocate, and initialize
    1-184Section 25.7: Dynamic class creation
    1-185Section 25.8: Class and instance variables
    1-186Chapter 26: Inheritance
    1-187Section 26.1: Subclasses
    1-188Section 26.2: What is inherited?
    1-189Section 26.3: Multiple Inheritance
    1-190Section 26.4: Mixins
    1-191Section 26.5: Refactoring existing classes to use Inheritance
    1-192Chapter 27: method_missing
    1-193Section 27.1: Catching calls to an undefined method
    1-194Section 27.2: Use with block
    1-195Section 27.3: Use with parameter
    1-196Section 27.4: Using the missing method
    1-197Chapter 28: Regular Expressions and Regex Based Operations
    1-198Section 28.1: =~ operator
    1-199Section 28.2: Regular Expressions in Case Statements
    1-200Section 28.3: Groups, named and otherwise
    1-201Section 28.4: Quantifiers
    1-202Section 28.5: Common quick usage
    1-203Section 28.6: match? - Boolean Result
    1-204Section 28.7: Defining a Regexp
    1-205Section 28.8: Character classes
    1-206Chapter 29: File and I/O Operations
    1-207Section 29.1: Writing a string to a file
    1-208Section 29.2: Reading from STDIN
    1-209Section 29.3: Reading from arguments with ARGV
    1-210Section 29.4: Open and closing a file
    1-211Section 29.5: get a single char of input
    1-212Chapter 30: Ruby Access Modifiers
    1-213Section 30.1: Instance Variables and Class Variables
    1-214Section 30.2: Access Controls
    1-215Chapter 31: Design Patterns and Idioms in Ruby
    1-216Section 31.1: Decorator Pattern
    1-217Section 31.2: Observer
    1-218Section 31.3: Singleton
    1-219Section 31.4: Proxy
    1-220Chapter 32: Loading Source Files
    1-221Section 32.1: Require files to be loaded only once
    1-222Section 32.2: Automatically loading source files
    1-223Section 32.3: Loading optional files
    1-224Section 32.4: Loading files repeatedly
    1-225Section 32.5: Loading several files
    1-226Chapter 33: Thread
    1-227Section 33.1: Accessing shared resources
    1-228Section 33.2: Basic Thread Semantics
    1-229Section 33.3: Terminating a Thread
    1-230Section 33.4: How to kill a thread
    1-231Chapter 34: Range
    1-232Section 34.1: Ranges as Sequences
    1-233Section 34.2: Iterating over a range
    1-234Section 34.3: Range between dates
    1-235Chapter 35: Modules
    1-236Section 35.1: A simple mixin with include
    1-237Section 35.2: Modules and Class Composition
    1-238Section 35.3: Module as Namespace
    1-239Section 35.4: A simple mixin with extend
    1-240Chapter 36: Introspection in Ruby
    1-241Section 36.1: Introspection of class
    1-242Section 36.2: Lets see some examples
    1-243Chapter 37: Monkey Patching in Ruby
    1-244Section 37.1: Changing an existing ruby method
    1-245Section 37.2: Monkey patching a class
    1-246Section 37.3: Monkey patching an object
    1-247Section 37.4: Safe Monkey patching with Refinements
    1-248Section 37.5: Changing a method with parameters
    1-249Section 37.6: Adding Functionality
    1-250Section 37.7: Changing any method
    1-251Section 37.8: Extending an existing class
    1-252Chapter 38: Recursion in Ruby
    1-253Section 38.1: Tail recursion
    1-254Section 38.2: Recursive function
    1-255Chapter 39: Splat operator (*)
    1-256Section 39.1: Variable number of arguments
    1-257Section 39.2: Coercing arrays into parameter list
    1-258Chapter 40: JSON with Ruby
    1-259Section 40.1: Using JSON with Ruby
    1-260Section 40.2: Using Symbols
    1-261Chapter 41: Pure RSpec JSON API testing
    1-262Section 41.1: Testing Serializer object and introducing it to Controller
    1-263Chapter 42: Gem Creation/Management
    1-264Section 42.1: Gemspec Files
    1-265Section 42.2: Building A Gem
    1-266Section 42.3: Dependencies
    1-267Chapter 43: rbenv
    1-268Section 43.1: Uninstalling a Ruby
    1-269Section 43.2: Install and manage versions of Ruby with rbenv
    1-270Chapter 44: Gem Usage
    1-271Section 44.1: Installing ruby gems
    1-272Section 44.2: Gem installation from github/filesystem
    1-273Section 44.3: Checking if a required gem is installed from within code
    1-274Section 44.4: Using a Gemfile and Bundler
    1-275Section 44.5: Bundler/inline (bundler v1.10 and later)
    1-276Chapter 45: Singleton Class
    1-277Section 45.1: Introduction
    1-278Section 45.2: Inheritance of Singleton Class
    1-279Section 45.3: Singleton classes
    1-280Section 45.4: Message Propagation with Singleton Class
    1-281Section 45.5: Reopening (monkey patching) Singleton Classes
    1-282Section 45.6: Accessing Singleton Class
    1-283Section 45.7: Accessing Instance/Class Variables in Singleton Classes
    1-284Chapter 46: Queue
    1-285Section 46.1: Multiple Workers One Sink
    1-286Section 46.2: Converting a Queue into an Array
    1-287Section 46.3: One Source Multiple Workers
    1-288Section 46.4: One Source - Pipeline of Work - One Sink
    1-289Section 46.5: Pushing Data into a Queue - #push
    1-290Section 46.6: Pulling Data from a Queue - #pop
    1-291Section 46.7: Synchronization - After a Point in Time
    1-292Section 46.8: Merging Two Queues
    1-293Chapter 47: Destructuring
    1-294Section 47.1: Overview
    1-295Section 47.2: Destructuring Block Arguments
    1-296Chapter 48: Struct
    1-297Section 48.1: Creating new structures for data
    1-298Section 48.2: Customizing a structure class
    1-299Section 48.3: Attribute lookup
    1-300Chapter 49: Metaprogramming
    1-301Section 49.1: Implementing "with" using instance evaluation
    1-302Section 49.2: send() method
    1-303Section 49.3: Defining methods dynamically
    1-304Section 49.4: Defining methods on instances
    1-305Chapter 50: Dynamic Evaluation
    1-306Section 50.1: Instance evaluation
    1-307Section 50.2: Evaluating a String
    1-308Section 50.3: Evaluating Inside a Binding
    1-309Section 50.4: Dynamically Creating Methods from Strings
    1-310Chapter 51: instance_eval
    1-311Section 51.1: Instance evaluation
    1-312Section 51.2: Implementing with
    1-313Chapter 52: Message Passing
    1-314Section 52.1: Introduction
    1-315Section 52.2: Message Passing Through Inheritance Chain
    1-316Section 52.3: Message Passing Through Module Composition
    1-317Section 52.4: Interrupting Messages
    1-318Chapter 53: Keyword Arguments
    1-319Section 53.1: Using arbitrary keyword arguments with splat operator
    1-320Section 53.2: Using keyword arguments
    1-321Section 53.3: Required keyword arguments
    1-322Chapter 54: Truthiness
    1-323Section 54.1: All objects may be converted to booleans in Ruby
    1-324Section 54.2: Truthiness of a value can be used in if-else constructs
    1-325Chapter 55: Implicit Receivers and Understanding Self
    1-326Section 55.1: There is always an implicit receiver
    1-327Section 55.2: Keywords change the implicit receiver
    1-328Section 55.3: When to use self?
    1-329Chapter 56: Introspection
    1-330Section 56.1: View an object's methods
    1-331Section 56.2: View an object's Instance Variables
    1-332Section 56.3: View Global and Local Variables
    1-333Section 56.4: View Class Variables
    1-334Chapter 57: Refinements
    1-335Section 57.1: Monkey patching with limited scope
    1-336Section 57.2: Dual-purpose modules (refinements or global patches)
    1-337Section 57.3: Dynamic refinements
    1-338Chapter 58: Catching Exceptions with Begin / Rescue
    1-339Section 58.1: A Basic Error Handling Block
    1-340Section 58.2: Saving the Error
    1-341Section 58.3: Checking for Dierent Errors
    1-342Section 58.4: Retrying
    1-343Section 58.5: Checking Whether No Error Was Raised
    1-344Section 58.6: Code That Should Always Run
    1-345Chapter 59: Command Line Apps
    1-346Section 59.1: How to write a command line tool to get the weather by zip code
    1-347Chapter 60: IRB
    1-348Section 60.1: Starting an IRB session inside a Ruby script
    1-349Section 60.2: Basic Usage
    1-350Chapter 61: ERB
    1-351Section 61.1: Parsing ERB
    1-352Chapter 62: Generate a random number
    1-353Section 62.1: 6 Sided die
    1-354Section 62.2: Generate a random number from a range (inclusive)
    1-355Chapter 63: Getting started with Hanami
    1-356Section 63.1: About Hanami
    1-357Section 63.2: How to install Hanami?
    1-358Section 63.3: How to start the server?
    1-359Chapter 64: OptionParser
    1-360Section 64.1: Mandatory and optional command line options
    1-361Section 64.2: Default values
    1-362Section 64.3: Long descriptions
    1-363Chapter 65: Operating System or Shell commands
    1-364Section 65.1: Recommended ways to execute shell code in Ruby:
    1-365Section 65.2: Clasic ways to execute shell code in Ruby:
    1-366Chapter 66: C Extensions
    1-367Section 66.1: Your first extension
    1-368Section 66.2: Working with C Structs
    1-369Section 66.3: Writing Inline C - RubyInLine
    1-370Chapter 67: Debugging
    1-371Section 67.1: Stepping through code with Pry and Byebug
    1-372Chapter 68: Ruby Version Manager
    1-373Section 68.1: How to create gemset
    1-374Section 68.2: Installing Ruby with RVM
    1-375Appendix A: Installation
    1-376Section A.1: Installing Ruby macOS
    1-377Section A.2: Gems
    1-378Section A.3: Linux - Compiling from source
    1-379Section A.4: Linux—Installation using a package manager
    1-380Section A.5: Windows - Installation using installer
    1-381Section A.6: Linux - troubleshooting gem install
    1-382Credits
    1-383You may also like

    常见问答

    您可以透過手機、平板或是電腦登入 HiSKIO 平台,在【我的學習】>【我的書籍】頁面,選擇想看的電子書。

    猜你喜欢

    用户评价

    | 收集中

    销售方案