Class: TerraspaceBundler::Mod::Props::Typer

Inherits:
Object
  • Object
show all
Includes:
Concerns::LocalConcern, Concerns::NotationConcern
Defined in:
lib/terraspace_bundler/mod/props/typer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Concerns::NotationConcern

#clean_notation, #ref, #remove_host, #remove_notations, #remove_ref_notation, #remove_subfolder_notation, #subfolder

Methods included from Concerns::LocalConcern

#local?

Constructor Details

#initialize(props) ⇒ Typer

Returns a new instance of Typer.



9
10
11
# File 'lib/terraspace_bundler/mod/props/typer.rb', line 9

def initialize(props)
  @props = props # Props.new object
end

Instance Attribute Details

#propsObject (readonly)

Returns the value of attribute props.



8
9
10
# File 'lib/terraspace_bundler/mod/props/typer.rb', line 8

def props
  @props
end

Instance Method Details

#typeObject

IE: git or registry



14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/terraspace_bundler/mod/props/typer.rb', line 14

def type
  if source.include?('ssh://')
    "git"
  elsif source.include?('::')
    source.split('::').first # IE: git:: s3:: gcs::
  elsif local?
    "local"
  elsif registry?
    "registry"
  else
    "git"
  end
end