Add remaining FileResource methods
This commit is contained in:
@@ -18,5 +18,21 @@ module Calligraphy
|
||||
def split_and_pop(path:, separator: '/')
|
||||
path.split(separator)[0..-2]
|
||||
end
|
||||
|
||||
def obj_exists_and_is_not_type?(obj:, type:)
|
||||
obj.nil? ? false : obj != type
|
||||
end
|
||||
|
||||
def map_array_of_hashes(arr_hashes)
|
||||
[].tap do |output_array|
|
||||
arr_hashes.each do |hash|
|
||||
output_array.push hash.map { |k, v| v }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def extract_lock_token(if_header)
|
||||
if_header.scan(Calligraphy::LOCK_TOKEN_REGEX)&.flatten[0]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user