Class: EY::Serverside::Callbacks::Hooks::Service

Inherits:
Base
  • Object
show all
Defined in:
lib/engineyard-serverside/callbacks/hooks/service.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#callback_name, #flavor, #path

Instance Method Summary collapse

Methods inherited from Base

#matches?, #read

Constructor Details

#initialize(file_path) ⇒ Service

Returns a new instance of Service.


11
12
13
14
# File 'lib/engineyard-serverside/callbacks/hooks/service.rb', line 11

def initialize(file_path)
  super
  @service_name = path.dirname.basename.to_s
end

Instance Attribute Details

#service_nameObject (readonly)

Returns the value of attribute service_name


9
10
11
# File 'lib/engineyard-serverside/callbacks/hooks/service.rb', line 9

def service_name
  @service_name
end

Instance Method Details

#short_nameObject


20
21
22
# File 'lib/engineyard-serverside/callbacks/hooks/service.rb', line 20

def short_name
  "#{service_name}/#{callback_name}"
end

#to_sObject


16
17
18
# File 'lib/engineyard-serverside/callbacks/hooks/service.rb', line 16

def to_s
  "service/#{service_name}/#{callback_name}"
end