Class: Rsvg::Handle
- Inherits:
-
Object
- Object
- Rsvg::Handle
- Defined in:
- lib/rsvg2/handle.rb
Class Method Summary collapse
-
.new_from_data(data) ⇒ Object
For backward compatibility.
-
.new_from_file(file_name, options = {}) ⇒ Object
For backward compatibility.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Handle
constructor
A new instance of Handle.
- #initialize_raw ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Handle
Returns a new instance of Handle.
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/rsvg2/handle.rb', line 32 def initialize(={}) flags = [:flags] path = [:path] || [:file] data = [:data] if path if flags Gio::File.open(:path => path) do |file| initialize_new_from_gfile_sync(file, flags) end else initialize_new_from_file(path) end elsif data initialize_new_from_data(data) else initialize_raw end end |
Class Method Details
.new_from_data(data) ⇒ Object
For backward compatibility
21 22 23 |
# File 'lib/rsvg2/handle.rb', line 21 def new_from_data(data) new(:data => data) end |
.new_from_file(file_name, options = {}) ⇒ Object
For backward compatibility
26 27 28 |
# File 'lib/rsvg2/handle.rb', line 26 def new_from_file(file_name, ={}) new(.merge(:file => file_name)) end |
Instance Method Details
#initialize_raw ⇒ Object
31 |
# File 'lib/rsvg2/handle.rb', line 31 alias_method :initialize_raw, :initialize |