Class: MeteoPl::IO::ImageOpener

Inherits:
Object
  • Object
show all
Defined in:
lib/meteo_pl/io/image_opener.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#pathObject

Returns the value of attribute path.



4
5
6
# File 'lib/meteo_pl/io/image_opener.rb', line 4

def path
  @path
end

Instance Method Details

#openObject



6
7
8
9
10
11
12
13
14
15
# File 'lib/meteo_pl/io/image_opener.rb', line 6

def open
  case RbConfig::CONFIG['host_os']
  when /mswin|mingw|cygwin/
    `start #{path}`
  when /darwin/
    `open #{path}`
  when /linux|bsd/
    `xdg-open #{path}`
  end
end