• Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off
Reading...
Front

Card Range To Study

through

image

Play button

image

Play button

image

Progress

1/20

Click to flip

Use LEFT and RIGHT arrow keys to navigate between flashcards;

Use UP and DOWN arrow keys to flip the card;

H to show hint;

A reads text to speech;

20 Cards in this Set

  • Front
  • Back

What is the difference between print & puts?

print does not include a newline character at the end of the string

Symbol to syphon program output into a file?

>

Syntax to write to a text file?

File.open fileName, 'mode' do |f|


f.write textObject


end

Syntax to load a text file?

objectName = File.read fileName

Syntax to search a directory for filenames that match a RegExp?

Dir[RegExp]

Syntax for string interpolation?

#{variableName/expression}

What file format is commonly used to store objects?

YAML

What syntax is required to include the YAML module?

require 'yaml'

syntax to write an object to YAML?

stringName=objectName.to_yaml


name=fileName


File.open name, 'mode' do |f|


f.write stringName


end


(as for text file, except first line added)

syntax to load a YAML file?

readString=File.read fileName


object=YAML::load readString

Class names always begin with a...?

capital letter

method to create a new instance of a class object?

className.new

syntax to create a new object representing the current point in time?

Time.new

syntax to create an object for an arbitrary point in time?

Time.local(y, m, d, [h], [m]...)

method to return the name of the class to which an object belongs?

object.class

What syntax is used for instance variables in the class method definitions?

@variableName

Syntax used to represent a global variable name?

$

What is a Block?

A process that sits between {} / do...end

What is a proc?

An object housing a Block

How to call a proc in a method?

proc.call