Class: Txgh::Config::Providers::GitProvider

Inherits:
Object
  • Object
show all
Defined in:
lib/txgh/config/providers/git_provider.rb

Direct Known Subclasses

GithubProvider, GitlabProvider

Constant Summary collapse

SCHEME =
'git'

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(payload, parser, options = {}) ⇒ GitProvider

Returns a new instance of GitProvider.



23
24
25
26
27
28
# File 'lib/txgh/config/providers/git_provider.rb', line 23

def initialize(payload, parser, options = {})
  @payload = payload
  @parser = parser
  @ref = options[:ref]
  @git_repo = options[:git_repo]
end

Instance Attribute Details

#parserObject (readonly)

Returns the value of attribute parser.



21
22
23
# File 'lib/txgh/config/providers/git_provider.rb', line 21

def parser
  @parser
end

#payloadObject (readonly)

Returns the value of attribute payload.



21
22
23
# File 'lib/txgh/config/providers/git_provider.rb', line 21

def payload
  @payload
end

Class Method Details

.load(payload, parser, options = {}) ⇒ Object



12
13
14
# File 'lib/txgh/config/providers/git_provider.rb', line 12

def load(payload, parser, options = {})
  new(payload, parser, options).config
end

.schemeObject



16
17
18
# File 'lib/txgh/config/providers/git_provider.rb', line 16

def scheme
  SCHEME
end

.supports?(scheme) ⇒ Boolean

Returns:

  • (Boolean)


8
9
10
# File 'lib/txgh/config/providers/git_provider.rb', line 8

def supports?(scheme)
  scheme == SCHEME
end

Instance Method Details

#configObject



30
31
32
# File 'lib/txgh/config/providers/git_provider.rb', line 30

def config
  parser.load(download)
end