Class: Kuby::Docker::Packages::Package

Inherits:
Object
  • Object
show all
Defined in:
lib/kuby/docker/packages/package.rb

Direct Known Subclasses

Nodejs, Yarn

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, version = nil) ⇒ Package

T::Sig::WithoutRuntime.sig { params(name: Symbol, version: T.nilable(String)).void }



19
20
21
22
# File 'lib/kuby/docker/packages/package.rb', line 19

def initialize(name, version = nil)
  @name = name
  @version = version
end

Instance Attribute Details

#nameObject (readonly)

T::Sig::WithoutRuntime.sig { returns(Symbol) }



13
14
15
# File 'lib/kuby/docker/packages/package.rb', line 13

def name
  @name
end

#versionObject (readonly)

T::Sig::WithoutRuntime.sig { returns(T.nilable(String)) }



16
17
18
# File 'lib/kuby/docker/packages/package.rb', line 16

def version
  @version
end

Instance Method Details

#managed?Boolean

T::Sig::WithoutRuntime.sig { returns(T::Boolean) }

Returns:

  • (Boolean)


30
31
32
# File 'lib/kuby/docker/packages/package.rb', line 30

def managed?
  false
end

#with_version(ver) ⇒ Object

T::Sig::WithoutRuntime.sig { params(ver: String).returns(T.self_type) }



25
26
27
# File 'lib/kuby/docker/packages/package.rb', line 25

def with_version(ver)
  self.class.new(name, ver)
end