Method: Gtk::Builder#initialize

Defined in:
lib/gtk3/builder.rb

#initialize(options = {}) ⇒ Builder

Returns a new instance of Builder.



65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# File 'lib/gtk3/builder.rb', line 65

def initialize(options={})
  path      = options[:path] || options[:file]
  resource  = options[:resource]
  string    = options[:string]

  if path
    path = path.to_path if path.respond_to?(:to_path)
    initialize_new_from_file(path)
  elsif resource
    initialize_new_from_resource(resource)
  elsif string
    initialize_new_from_string(string, string.bytesize)
  else
    initialize_raw
  end
end