Class: DaggerRuby::Host

Inherits:
DaggerObject show all
Defined in:
lib/dagger_ruby/host.rb

Instance Attribute Summary

Attributes inherited from DaggerObject

#client, #query_builder

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from DaggerObject

#chain_operation, from_id, #id, #initialize

Constructor Details

This class inherits a constructor from DaggerRuby::DaggerObject

Class Method Details

.root_field_nameObject



8
9
10
# File 'lib/dagger_ruby/host.rb', line 8

def self.root_field_name
  "host"
end

Instance Method Details

#directory(path, opts = {}) ⇒ Object



12
13
14
15
16
17
18
19
20
# File 'lib/dagger_ruby/host.rb', line 12

def directory(path, opts = {})
  args = { "path" => path }
  args["exclude"] = opts[:exclude] if opts[:exclude]
  args["include"] = opts[:include] if opts[:include]
  args["noCache"] = opts[:no_cache] if opts.key?(:no_cache)
  args["gitignore"] = opts[:gitignore] if opts[:gitignore]

  get_object("directory", Directory, args)
end

#file(path, no_cache: nil) ⇒ Object



22
23
24
25
26
# File 'lib/dagger_ruby/host.rb', line 22

def file(path, no_cache: nil)
  args = { "path" => path }
  args["noCache"] = no_cache unless no_cache.nil?
  get_object("file", File, args)
end

#syncObject



32
33
34
35
# File 'lib/dagger_ruby/host.rb', line 32

def sync
  get_scalar("id")
  self
end

#unix_socket(path) ⇒ Object



28
29
30
# File 'lib/dagger_ruby/host.rb', line 28

def unix_socket(path)
  get_object("unixSocket", Socket, { "path" => path })
end