Class: ProxyTester::GitFile

Inherits:
Object
  • Object
show all
Defined in:
lib/proxy_tester/git_file.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path, content = '') ⇒ GitFile

Returns a new instance of GitFile.



12
13
14
15
16
17
# File 'lib/proxy_tester/git_file.rb', line 12

def initialize(path, content = '')
  @path      = path
  @extension = ::File.extname(path)
  @name      = path.sub(/\.[^.]+$/, '').gsub(%r{/}, '::').downcase.to_sym
  @content   = content
end

Instance Attribute Details

#contentObject (readonly)

Returns the value of attribute content.



10
11
12
# File 'lib/proxy_tester/git_file.rb', line 10

def content
  @content
end

#nameObject (readonly)

Returns the value of attribute name.



10
11
12
# File 'lib/proxy_tester/git_file.rb', line 10

def name
  @name
end

#pathObject (readonly)

Returns the value of attribute path.



10
11
12
# File 'lib/proxy_tester/git_file.rb', line 10

def path
  @path
end

Instance Method Details

#extension?(ext) ⇒ Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/proxy_tester/git_file.rb', line 23

def extension?(ext)
  extension == ext
end

#nil?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/proxy_tester/git_file.rb', line 19

def nil?
  false
end

#prepare(handler) ⇒ Object



27
28
29
# File 'lib/proxy_tester/git_file.rb', line 27

def prepare(handler)
  handler.prepare(self)
end