Method: IGV.open

Defined in:
lib/igv.rb

.open(host: '127.0.0.1', port: 60_151, snapshot_dir: Dir.pwd) {|IGV| ... } ⇒ IGV

Create IGV object and connect to IGV server. This method accepts a block.

Parameters:

  • host (String) (defaults to: '127.0.0.1')

    Hostname or IP address of IGV server.

  • port (Integer) (defaults to: 60_151)

    Port number of IGV server.

  • snapshot_dir (String) (defaults to: Dir.pwd)

    Directory path to save snapshots.

Yields:

  • (IGV)

    IGV client object.

Returns:

  • (IGV)

    IGV client object.



40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/igv.rb', line 40

def self.open(host: '127.0.0.1', port: 60_151, snapshot_dir: Dir.pwd)
  igv = new(host: host, port: port, snapshot_dir: snapshot_dir)
  igv.connect
  return igv unless block_given?

  begin
    yield igv
  ensure
    @socket&.close
  end
  igv
end