Class: Cask::DSL::Container Private
Overview
This class is part of a private API. This class may only be used in the Homebrew/brew repository. Third parties should avoid using this class if possible, as it may be removed or changed without warning.
Class corresponding to the container stanza.
Instance Attribute Summary collapse
- #nested ⇒ String? private
- #type ⇒ Symbol? private
Instance Method Summary collapse
- #initialize(nested: nil, type: nil) ⇒ void constructor private
- #pairs ⇒ Hash{Symbol => String, Symbol, nil} private
- #to_yaml ⇒ String private
Constructor Details
#initialize(nested: nil, type: nil) ⇒ void
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
17 18 19 20 21 22 23 24 25 |
# File 'cask/dsl/container.rb', line 17 def initialize(nested: nil, type: nil) @nested = T.let(nested, T.nilable(String)) @type = T.let(type, T.nilable(Symbol)) return if type.nil? return unless UnpackStrategy.from_type(type).nil? raise "invalid container type: #{type.inspect}" end |
Instance Attribute Details
#nested ⇒ String?
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
11 12 13 |
# File 'cask/dsl/container.rb', line 11 def nested @nested end |
#type ⇒ Symbol?
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
14 15 16 |
# File 'cask/dsl/container.rb', line 14 def type @type end |
Instance Method Details
#pairs ⇒ Hash{Symbol => String, Symbol, nil}
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
28 29 30 |
# File 'cask/dsl/container.rb', line 28 def pairs instance_variables.to_h { |ivar| [ivar[1..].to_sym, instance_variable_get(ivar)] }.compact end |
#to_yaml ⇒ String
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
33 34 35 |
# File 'cask/dsl/container.rb', line 33 def to_yaml pairs.to_yaml end |