Class: CKick::Path

Inherits:
Object
  • Object
show all
Defined in:
lib/ckick/path.rb

Direct Known Subclasses

IncludePath, LibraryPath

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args = {}) ⇒ Path

Returns a new instance of Path.



10
11
12
13
14
15
# File 'lib/ckick/path.rb', line 10

def initialize args={}
  raise IllegalInitializationError, "needs :path parameter" unless args.is_a?(Hash) && args[:path].is_a?(String)
  raise NoSuchDirectoryError, "invalid path #{args[:path]}" unless Dir.exist?(args[:path])

  @path = args[:path]
end

Instance Attribute Details

#pathObject (readonly)

Returns the value of attribute path.



8
9
10
# File 'lib/ckick/path.rb', line 8

def path
  @path
end

Instance Method Details

#to_hash_elementObject



21
22
23
# File 'lib/ckick/path.rb', line 21

def to_hash_element
  @path
end

#to_sObject



17
18
19
# File 'lib/ckick/path.rb', line 17

def to_s
  @path
end