allocate

class.allocate() â obj Instance Public methods Allocates space for a new object of class's class and does not call initialize on the new instance. The returned object must be an instance of class. klass = Class.new do def initialize(*args) @initialized = true end def initialized? @initialized || false end end klass.allocate.initialized? #=> false

json_creatable?

json_creatable?() Instance Public methods Returns true if this class can be used to create an instance from a serialised JSON string. The class has to implement a class method json_create that expects a hash as first parameter. The hash should include the required data.

new 2

class.new(args, ...) â obj Instance Public methods Calls allocate to create a new object of class's class, then invokes that object's initialize method, passing it args. This is the method that ends up getting called whenever an object is constructed using .new.

superclass

class.superclass â a_super_class or nil Instance Public methods Returns the superclass of class, or nil. File.superclass #=> IO IO.superclass #=> Object Object.superclass #=> BasicObject class Foo; end class Bar < Foo; end Bar.superclass #=> Foo returns nil when the given class hasn't a parent class: BasicObject.superclass #=> nil

new

new(clock24 = true) Class Public methods

_create_marks

_create_marks() Instance Public methods

coords_to_time

coords_to_time(x, y) Instance Public methods

create_pie

create_pie(hh, mm, span, color='red') Instance Public methods

set_hands

set_hands(hh, mm, ss) Instance Public methods

update

update(h, m, s) Instance Public methods