Class: Brut::CLI::Apps::New::AddSegmentOptions

Inherits:
Object
  • Object
show all
Defined in:
lib/brut/cli/apps/new/add_segment_options.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(segment_name:, project_root:, dry_run: nil, versions: nil, **rest) ⇒ AddSegmentOptions

Returns a new instance of AddSegmentOptions.



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/brut/cli/apps/new/add_segment_options.rb', line 4

def initialize(
  segment_name:,
  project_root:,
  dry_run: nil,
  versions: nil,
  **rest
)
  if segment_name.nil?
    raise ArgumentError, "segment_name is required"
  end

  @segment_name =   segment_name
  @project_root =   project_root
  @dry_run      = !!dry_run
  @versions     =   versions
end

Instance Attribute Details

#project_rootObject (readonly)

Returns the value of attribute project_root.



2
3
4
# File 'lib/brut/cli/apps/new/add_segment_options.rb', line 2

def project_root
  @project_root
end

#segment_nameObject (readonly)

Returns the value of attribute segment_name.



2
3
4
# File 'lib/brut/cli/apps/new/add_segment_options.rb', line 2

def segment_name
  @segment_name
end

Instance Method Details

#dry_run?Boolean

Returns:

  • (Boolean)


21
# File 'lib/brut/cli/apps/new/add_segment_options.rb', line 21

def dry_run? = @dry_run