Results for: "pstore"

Returns true if mod is a singleton class or false if it is an ordinary class or module.

class C
end
C.singleton_class?                  #=> false
C.singleton_class.singleton_class?  #=> true

Returns an UnboundMethod representing the given instance method in mod.

class Interpreter
  def do_a() print "there, "; end
  def do_d() print "Hello ";  end
  def do_e() print "!\n";     end
  def do_v() print "Dave";    end
  Dispatcher = {
    "a" => instance_method(:do_a),
    "d" => instance_method(:do_d),
    "e" => instance_method(:do_e),
    "v" => instance_method(:do_v)
  }
  def interpret(string)
    string.each_char {|b| Dispatcher[b].bind(self).call }
  end
end

interpreter = Interpreter.new
interpreter.interpret('dave')

produces:

Hello there, Dave!

Removes the method identified by symbol from the current class. For an example, see Module.undef_method. String arguments are converted to symbols.

Returns the value as an integer (Fixnum or Bignum).

If the BigNumber is infinity or NaN, raises FloatDomainError.

Converts a BigDecimal to a String of the form “nnnnnn.mmm”. This method is deprecated; use BigDecimal#to_s(“F”) instead.

require 'bigdecimal'
require 'bigdecimal/util'

d = BigDecimal.new("3.14")
d.to_digits
# => "3.14"

Import a JSON Marshalled object.

method used for JSON marshalling support.

return the JSON value

Casts an Integer as an OpenSSL::BN

See ‘man bn` for more info.

As int is already an Integer, all these methods simply return the receiver.

Synonyms are to_int, floor, ceil, truncate.

Deserializes JSON string by converting numerator value n, denominator value d, to a Rational object.

Stores class name (Rational) along with numerator value n and denominator value d as JSON string

Returns true if the given ordinal date is valid, and false if not.

Date.valid_ordinal?(2001,34)      #=> true
Date.valid_ordinal?(2001,366)     #=> false

See also jd and ordinal.

Duplicates self and resets its the day of calendar reform.

d = Date.new(1582,10,15)
d.new_start(Date::JULIAN)         #=> #<Date: 1582-10-05 ...>

This method is equivalent to d - n.

This method is equivalent to d << n

This method is equivalent to d << (n * 12)

Returns a Time object which denotes self.

Returns self;

Returns a DateTime object which denotes self.

Deserializes JSON string by converting Julian year y, month m, day d and Day of Calendar Reform sg to Date.

Stores class name (Date) with Julian year y, month m, day d and Day of Calendar Reform sg as JSON string

Returns a Time object which denotes self.

Returns a Date object which denotes self.

Returns self.

Deserializes JSON string by converting year y, month m, day d, hour H, minute M, second S, offset of and Day of Calendar Reform sg to DateTime.

Search took: 4ms  ·  Total Results: 3306