Class: CKick::Path
- Inherits:
-
Object
- Object
- CKick::Path
- Defined in:
- lib/ckick/path.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
-
#initialize(args = {}) ⇒ Path
constructor
A new instance of Path.
- #to_hash_element ⇒ Object
- #to_s ⇒ Object
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
#path ⇒ Object (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_element ⇒ Object
21 22 23 |
# File 'lib/ckick/path.rb', line 21 def to_hash_element @path end |
#to_s ⇒ Object
17 18 19 |
# File 'lib/ckick/path.rb', line 17 def to_s @path end |