Class: IRuby::Display::Representation

Inherits:
Object
  • Object
show all
Defined in:
lib/iruby/display.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(object, options) ⇒ Representation

Returns a new instance of Representation.



75
76
77
# File 'lib/iruby/display.rb', line 75

def initialize(object, options)
  @object, @options = object, options
end

Instance Attribute Details

#objectObject (readonly)

Returns the value of attribute object.



73
74
75
# File 'lib/iruby/display.rb', line 73

def object
  @object
end

#optionsObject (readonly)

Returns the value of attribute options.



73
74
75
# File 'lib/iruby/display.rb', line 73

def options
  @options
end

Class Method Details

.new(obj, options) ⇒ Object



82
83
84
85
86
87
88
89
# File 'lib/iruby/display.rb', line 82

def new(obj, options)
  options = { format: options } if String === options
  if Representation === obj
    options = obj.options.merge(options)
    obj = obj.object
  end
  old_new(obj, options)
end

.old_newObject



80
# File 'lib/iruby/display.rb', line 80

alias old_new new