Class: FilePathAndPermissions
- Defined in:
- lib/gpm/file_path_and_permissions.rb
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#permissions ⇒ Object
readonly
Returns the value of attribute permissions.
Instance Method Summary collapse
- #eql?(other) ⇒ Boolean
- #hash ⇒ Object
-
#initialize(path, permissions = 0444) ⇒ FilePathAndPermissions
constructor
A new instance of FilePathAndPermissions.
- #inspect ⇒ Object
Constructor Details
#initialize(path, permissions = 0444) ⇒ FilePathAndPermissions
Returns a new instance of FilePathAndPermissions.
4 5 6 7 8 |
# File 'lib/gpm/file_path_and_permissions.rb', line 4 def initialize(path, = 0444) @path = path.to_s super(@path) @permissions = end |
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
3 4 5 |
# File 'lib/gpm/file_path_and_permissions.rb', line 3 def path @path end |
#permissions ⇒ Object (readonly)
Returns the value of attribute permissions.
3 4 5 |
# File 'lib/gpm/file_path_and_permissions.rb', line 3 def @permissions end |
Instance Method Details
#eql?(other) ⇒ Boolean
10 11 12 13 14 |
# File 'lib/gpm/file_path_and_permissions.rb', line 10 def eql?(other) return @path == other if other.is_a? String return @path == other.path if other.is_a? FilePathAndPermissions super end |
#hash ⇒ Object
21 22 23 |
# File 'lib/gpm/file_path_and_permissions.rb', line 21 def hash @path.hash end |
#inspect ⇒ Object
16 17 18 19 |
# File 'lib/gpm/file_path_and_permissions.rb', line 16 def inspect vars = instance_variables.collect { |v| v.to_s << "=#{instance_variable_get(v).inspect}"}.join(", ") "#<#{self.class}:#{vars}>" end |