Results for: "pstore"

Returns the list of loaded encodings.

Encoding.list
#=> [#<Encoding:ASCII-8BIT>, #<Encoding:UTF-8>,
      #<Encoding:ISO-2022-JP (dummy)>]

Encoding.find("US-ASCII")
#=> #<Encoding:US-ASCII>

Encoding.list
#=> [#<Encoding:ASCII-8BIT>, #<Encoding:UTF-8>,
      #<Encoding:US-ASCII>, #<Encoding:ISO-2022-JP (dummy)>]

Rewinds the enumeration sequence to the beginning.

If the enclosed object responds to a “rewind” method, it is called.

Returns the return value of the iterator.

o = Object.new
def o.each
  yield 1
  yield 2
  yield 3
  100
end

e = o.to_enum

puts e.next                   #=> 1
puts e.next                   #=> 2
puts e.next                   #=> 3

begin
  e.next
rescue StopIteration => ex
  puts ex.result              #=> 100
end

Returns exception’s message (or the name of the exception if no message is set).

Return the status value associated with this system exit.

Return the receiver associated with this KeyError exception.

Return the receiver associated with this NameError exception.

Return the receiver associated with this FrozenError exception.

Invokes Module.prepend_features on each parameter in reverse order.

Refine mod in the receiver.

Returns a module, where refined methods are defined.

Returns the list of Modules nested at the point of call.

module M1
  module M2
    $a = Module.nesting
  end
end
$a           #=> [M1::M2, M1]
$a[0].name   #=> "M1::M2"

In the first form, returns an array of the names of all constants accessible from the point of call. This list includes the names of all modules and classes defined in the global scope.

Module.constants.first(4)
   # => [:ARGF, :ARGV, :ArgumentError, :Array]

Module.constants.include?(:SEEK_SET)   # => false

class IO
  Module.constants.include?(:SEEK_SET) # => true
end

The second form calls the instance method constants.

Registers filename to be loaded (using Kernel::require) the first time that module (which may be a String or a symbol) is accessed in the namespace of mod.

module A
end
A.autoload(:B, "b")
A::B.doit            # autoloads "b"

Returns filename to be loaded if name is registered as autoload in the namespace of mod or one of its ancestors.

module A
end
A.autoload(:B, "b")
A.autoload?(:B)            #=> "b"

If inherit is false, the lookup only checks the autoloads in the receiver:

class A
  autoload :CONST, "const.rb"
end

class B < A
end

B.autoload?(:CONST)          #=> "const.rb", found in A (ancestor)
B.autoload?(:CONST, false)   #=> nil, not found in B itself

Callback invoked whenever the receiver is included in another module or class. This should be used in preference to Module.append_features if your code wants to perform some action when a module is included in another.

module A
  def A.included(mod)
    puts "#{self} included in #{mod}"
  end
end
module Enumerable
  include A
end
 # => prints "A included in Enumerable"

Prevents further modifications to mod.

This method returns self.

Returns a string representing this module or class. For basic classes and modules, this is the name. For singletons, we show information on the thing we’re attached to as well.

Returns an array of the names of the constants accessible in mod. This includes the names of constants in any included modules (example at start of section), unless the inherit parameter is set to false.

The implementation makes no guarantees about the order in which the constants are yielded.

IO.constants.include?(:SYNC)        #=> true
IO.constants(false).include?(:SYNC) #=> false

Also see Module#const_defined?.

Returns an Array of two Integer values that represent platform-dependent internal storage properties.

This method is deprecated and will be removed in the future. Instead, use BigDecimal#n_significant_digits for obtaining the number of significant digits in scientific notation, and BigDecimal#precision for obtaining the number of digits in decimal notation.

BigDecimal('5').precs #=> [9, 18]

Returns the number of decimal digits in this number.

Example:

BigDecimal("0").precision  # => 0
BigDecimal("1").precision  # => 1
BigDecimal("-1e20").precision  # => 21
BigDecimal("1e-20").precision  # => 20
BigDecimal("Infinity").precision  # => 0
BigDecimal("-Infinity").precision  # => 0
BigDecimal("NaN").precision  # => 0

Converts the value to a string.

The default format looks like 0.xxxxEnn.

The optional parameter s consists of either an integer; or an optional ‘+’ or ‘ ’, followed by an optional number, followed by an optional ‘E’ or ‘F’.

If there is a ‘+’ at the start of s, positive values are returned with a leading ‘+’.

A space at the start of s returns positive values with a leading space.

If s contains a number, a space is inserted after each group of that many fractional digits.

If s ends with an ‘E’, engineering notation (0.xxxxEnn) is used.

If s ends with an ‘F’, conventional floating point notation is used.

Examples:

BigDecimal('-123.45678901234567890').to_s('5F')
  #=> '-123.45678 90123 45678 9'

BigDecimal('123.45678901234567890').to_s('+8F')
  #=> '+123.45678901 23456789'

BigDecimal('123.45678901234567890').to_s(' F')
  #=> ' 123.4567890123456789'

Returns the value as an Integer.

If the BigDecimal is infinity or NaN, raises FloatDomainError.

Converts a BigDecimal to a Rational.

Returns the remainder from dividing by the value.

x.remainder(y) means x-y*(x/y).truncate

Returns a new Float object having approximately the same value as the BigDecimal number. Normal accuracy limits and built-in errors of binary Float arithmetic apply.

Search took: 4ms  ·  Total Results: 2928