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, :auto_merge, :milestone, :remove_source_branch, :squash, :target, :target_project, :title, :unassign, :unlabel ] }, ci: { keys: [:skip, :variable, :input] }, integrations: { keys: [:skip_ci] }, secret_detection: { keys: [:skip_all] }, secret_push_protection: { keys: [:skip_all] }, security_policy: { keys: [:bypass_reason] } }).freeze
- MULTI_VALUE_OPTIONS =
[ %w[ci input], %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.
61 62 63 |
# File 'lib/gitlab/push_options.rb', line 61 def initialize( = []) @options = () end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
59 60 61 |
# File 'lib/gitlab/push_options.rb', line 59 def @options end |
Instance Method Details
#as_json(*_args) ⇒ Object
Allow #to_json serialization
70 71 72 |
# File 'lib/gitlab/push_options.rb', line 70 def as_json(*_args) .as_json end |
#get ⇒ Object
65 66 67 |
# File 'lib/gitlab/push_options.rb', line 65 def get(...) .dig(...) end |