Class: Gitlab::PushOptions
- Inherits:
-
Object
- Object
- Gitlab::PushOptions
- Defined in:
- lib/gitlab/push_options.rb
Constant Summary collapse
- VALID_OPTIONS =
HashWithIndifferentAccess.new({ merge_request: { keys: [ :assign, :create, :description, :draft, :label, :merge_when_pipeline_succeeds, :milestone, :remove_source_branch, :squash, :target, :target_project, :title, :unassign, :unlabel ] }, ci: { keys: [:skip, :variable] }, integrations: { keys: [:skip_ci] }, secret_detection: { keys: [:skip_all] }, secret_push_protection: { keys: [:skip_all] } }).freeze
- MULTI_VALUE_OPTIONS =
[ %w[ci variable], %w[merge_request label], %w[merge_request unlabel], %w[merge_request assign], %w[merge_request unassign] ].freeze
- NAMESPACE_ALIASES =
HashWithIndifferentAccess.new({ mr: :merge_request }).freeze
- OPTION_MATCHER =
Gitlab::UntrustedRegexp.new('(?<namespace>[^\.]+)\.(?<key>[^=]+)=?(?<value>.*)')
- CI_SKIP =
'ci.skip'
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#as_json(*_args) ⇒ Object
Allow #to_json serialization.
- #get ⇒ Object
-
#initialize(options = []) ⇒ PushOptions
constructor
A new instance of PushOptions.
Constructor Details
#initialize(options = []) ⇒ PushOptions
Returns a new instance of PushOptions.
56 57 58 |
# File 'lib/gitlab/push_options.rb', line 56 def initialize( = []) @options = () end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
54 55 56 |
# File 'lib/gitlab/push_options.rb', line 54 def @options end |
Instance Method Details
#as_json(*_args) ⇒ Object
Allow #to_json serialization
65 66 67 |
# File 'lib/gitlab/push_options.rb', line 65 def as_json(*_args) end |
#get ⇒ Object
60 61 62 |
# File 'lib/gitlab/push_options.rb', line 60 def get(...) .dig(...) end |