Results for: "tally"

An InstalledSpecification represents a gem that is already installed locally.

A set of gems for installation sourced from remote sources and local .gem files

Represents an installed gem. This is used for dependency resolution.

Extends Fiddle::Closure to allow for building the closure in a block

Raised when the buffer cannot be allocated for some reason, or you try to use a buffer that’s not allocated.

No documentation available

Raised when a tar file is corrupt

Shows the context around code provided by “falling” indentation

If this is the original code lines:

class OH
  def hello
    it "foo" do
  end
end

And this is the line that is captured

it "foo" do

It will yield its surrounding context:

class OH
  def hello
  end
end

Example:

FallingIndentLines.new(
    block: block,
    code_lines: @code_lines
).call do |line|
  @lines_to_output << line
end

Wrapper for arrays within a struct

No documentation available

This class is used as a return value from ObjectSpace::reachable_objects_from.

When ObjectSpace::reachable_objects_from returns an object with references to an internal object, an instance of this class is returned.

You can use the type method to check the type of the internal object.

No documentation available

Subclasses ‘BadAlias` for backwards compatibility

Scan scalars for built in types

No documentation available

Subclass of Zlib::Error when zlib returns a Z_DATA_ERROR.

Usually if a stream was prematurely freed.

Objects of class File::Stat encapsulate common status information for File objects. The information is recorded at the moment the File::Stat object is created; changes made to the file after that point will not be reflected. File::Stat objects are returned by IO#stat, File::stat, File#lstat, and File::lstat. Many of these methods return platform-specific values, and not all values are meaningful on all systems. See also Kernel#test.

exception to wait for writing by EAGAIN. see IO.select.

exception to wait for writing by EWOULDBLOCK. see IO.select.

exception to wait for writing by EINPROGRESS. see IO.select.

Exception raised when there is an invalid encoding detected

The error thrown when the parser encounters illegal CSV formatting.

The error thrown when the parser encounters invalid encoding in CSV.

CSV::Table

A CSV::Table instance represents CSV data. (see class CSV).

The instance may have:

Instance Methods

CSV::Table has three groups of instance methods:

Creating a CSV::Table Instance

Commonly, a new CSV::Table instance is created by parsing CSV source using headers:

source = "Name,Value\nfoo,0\nbar,1\nbaz,2\n"
table = CSV.parse(source, headers: true)
table.class # => CSV::Table

You can also create an instance directly. See ::new.

Headers

If a table has headers, the headers serve as labels for the columns of data. Each header serves as the label for its column.

The headers for a CSV::Table object are stored as an Array of Strings.

Commonly, headers are defined in the first row of CSV source:

source = "Name,Value\nfoo,0\nbar,1\nbaz,2\n"
table = CSV.parse(source, headers: true)
table.headers # => ["Name", "Value"]

If no headers are defined, the Array is empty:

table = CSV::Table.new([])
table.headers # => []

Access Modes

CSV::Table provides three modes for accessing table data:

The access mode for aCSV::Table instance affects the behavior of some of its instance methods:

Row Mode

Set a table to row mode with method by_row!:

source = "Name,Value\nfoo,0\nbar,1\nbaz,2\n"
table = CSV.parse(source, headers: true)
table.by_row! # => #<CSV::Table mode:row row_count:4>

Specify a single row by an Integer index:

# Get a row.
table[1] # => #<CSV::Row "Name":"bar" "Value":"1">
# Set a row, then get it.
table[1] = CSV::Row.new(['Name', 'Value'], ['bam', 3])
table[1] # => #<CSV::Row "Name":"bam" "Value":3>

Specify a sequence of rows by a Range:

# Get rows.
table[1..2] # => [#<CSV::Row "Name":"bam" "Value":3>, #<CSV::Row "Name":"baz" "Value":"2">]
# Set rows, then get them.
table[1..2] = [
  CSV::Row.new(['Name', 'Value'], ['bat', 4]),
  CSV::Row.new(['Name', 'Value'], ['bad', 5]),
]
table[1..2] # => [["Name", #<CSV::Row "Name":"bat" "Value":4>], ["Value", #<CSV::Row "Name":"bad" "Value":5>]]

Column Mode

Set a table to column mode with method by_col!:

source = "Name,Value\nfoo,0\nbar,1\nbaz,2\n"
table = CSV.parse(source, headers: true)
table.by_col! # => #<CSV::Table mode:col row_count:4>

Specify a column by an Integer index:

# Get a column.
table[0]
# Set a column, then get it.
table[0] = ['FOO', 'BAR', 'BAZ']
table[0] # => ["FOO", "BAR", "BAZ"]

Specify a column by its String header:

# Get a column.
table['Name'] # => ["FOO", "BAR", "BAZ"]
# Set a column, then get it.
table['Name'] = ['Foo', 'Bar', 'Baz']
table['Name'] # => ["Foo", "Bar", "Baz"]

Mixed Mode

In mixed mode, you can refer to either rows or columns:

Set a table to mixed mode with method by_col_or_row!:

source = "Name,Value\nfoo,0\nbar,1\nbaz,2\n"
table = CSV.parse(source, headers: true)
table.by_col_or_row! # => #<CSV::Table mode:col_or_row row_count:4>

Specify a single row by an Integer index:

# Get a row.
table[1] # => #<CSV::Row "Name":"bar" "Value":"1">
# Set a row, then get it.
table[1] = CSV::Row.new(['Name', 'Value'], ['bam', 3])
table[1] # => #<CSV::Row "Name":"bam" "Value":3>

Specify a sequence of rows by a Range:

# Get rows.
table[1..2] # => [#<CSV::Row "Name":"bam" "Value":3>, #<CSV::Row "Name":"baz" "Value":"2">]
# Set rows, then get them.
table[1] = CSV::Row.new(['Name', 'Value'], ['bat', 4])
table[2] = CSV::Row.new(['Name', 'Value'], ['bad', 5])
table[1..2] # => [["Name", #<CSV::Row "Name":"bat" "Value":4>], ["Value", #<CSV::Row "Name":"bad" "Value":5>]]

Specify a column by its String header:

# Get a column.
table['Name'] # => ["foo", "bat", "bad"]
# Set a column, then get it.
table['Name'] = ['Foo', 'Bar', 'Baz']
table['Name'] # => ["Foo", "Bar", "Baz"]
No documentation available
Search took: 8ms  ·  Total Results: 1651