Skip to content

Commit

Permalink
CameraFolder#up -> #parent
Browse files Browse the repository at this point in the history
  • Loading branch information
Sija committed Dec 23, 2023
1 parent f27527d commit 259e06c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/gphoto2/camera_folder.cr
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ module GPhoto2
# Returns `CameraFolder` by *name*, relative to current `#path`.
def cd(name : String) : self
case name
when ".." then up
when ".." then parent
when "." then self
else
self.class.new(@camera, CameraFile.join(@path, name))
Expand All @@ -51,13 +51,13 @@ module GPhoto2
end

# Returns parent `CameraFolder` or `nil`.
def up? : self?
def parent? : self?
self.class.new(@camera, parent_path) unless root?
end

# Returns parent `CameraFolder` or `self`.
def up : self
up? || self
def parent : self
parent? || self
end

# Deletes all files and/or folders.
Expand Down

0 comments on commit 259e06c

Please sign in to comment.