Class: Repomen::Repo::Service::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/repomen/repo/service/base.rb

Direct Known Subclasses

BitBucket, GitHub

Constant Summary collapse

SERVICE_REGEXP =
//

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(url) ⇒ Base

Returns a new instance of Base.



14
15
16
# File 'lib/repomen/repo/service/base.rb', line 14

def initialize(url)
  @url = url
end

Instance Attribute Details

#urlObject (readonly)

Returns the value of attribute url.



7
8
9
# File 'lib/repomen/repo/service/base.rb', line 7

def url
  @url
end

Instance Method Details

#applicable?Boolean

Parameters:

  • url (String)

Returns:

  • (Boolean)


10
11
12
# File 'lib/repomen/repo/service/base.rb', line 10

def applicable?
  url =~ SERVICE_REGEXP
end

#nameObject



18
19
20
# File 'lib/repomen/repo/service/base.rb', line 18

def name
  self.class.to_s.split("::").last.underscore.to_sym
end