Class: Object

Inherits:
BasicObject
Defined in:
lib/plotly/util.rb

Instance Method Summary collapse

Instance Method Details

#convert_to(clazz) ⇒ Object



2
3
4
5
6
7
8
9
10
# File 'lib/plotly/util.rb', line 2

def convert_to(clazz)
  if is_a?(Hash)
    clazz.new(self)
  elsif !is_a?(clazz)
    raise # @todo raise type error
  else
    self
  end
end