Skip to content

Commit 028871e

Browse files
committed
refactor: rename generateTransformationString to buildTransformationString for consistency
1 parent 67d2ecb commit 028871e

File tree

4 files changed

+11
-6
lines changed

4 files changed

+11
-6
lines changed

examples/test_helper.rb

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,20 @@
1313
# Create some sample transformations (they can be empty for now since we're returning a fixed URL)
1414
transformations = [
1515
Imagekit::Models::Transformation.new(
16-
height: 300,
17-
width: 400,
16+
height: 300.0,
17+
width: 400.0,
1818
shadow: true
1919
)
2020
]
2121

2222
# Test all helper functions
2323
puts "Testing helper functions:"
2424
puts "1. buildURL: #{image_kit.helper.buildURL(transformations)}"
25-
puts "2. generateTransformationString: #{image_kit.helper.generateTransformationString(transformations)}"
25+
puts "2. buildTransformationString: #{image_kit.helper.buildTransformationString(transformations)}"
2626
puts "3. GetAuthenticationParameters: #{image_kit.helper.GetAuthenticationParameters}"
2727
puts "All helper functions are working!"
28+
29+
image_kit.files.upload(
30+
file: StringIO.new("https://www.example.com/public-url.jpg"),
31+
file_name: "file-name.jpg"
32+
)

lib/imagekit/helpers/helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def buildURL(transformations)
1717
#
1818
# @param transformations [Array<Imagekit::Models::Transformation>] Array of transformation objects
1919
# @return [String] The transformation string (e.g., "w-400,h-300")
20-
def generateTransformationString(transformations)
20+
def buildTransformationString(transformations)
2121
# TODO: Implement actual transformation string generation
2222
# For now, return a fixed transformation string
2323
"w-400,h-300"

rbi/imagekit/helpers/helper.rbi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ module Imagekit
2020
transformations: T::Array[Imagekit::Models::Transformation]
2121
).returns(String)
2222
end
23-
def generateTransformationString(transformations); end
23+
def buildTransformationString(transformations); end
2424

2525
# Gets authentication parameters for ImageKit requests
2626
sig do

sig/imagekit/helpers/helper.rbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ module Imagekit
77
def buildURL: (Array[Imagekit::Models::Transformation] transformations) -> String
88

99
# Generates transformation string from transformation objects
10-
def generateTransformationString: (Array[Imagekit::Models::Transformation] transformations) -> String
10+
def buildTransformationString: (Array[Imagekit::Models::Transformation] transformations) -> String
1111

1212
# Gets authentication parameters for ImageKit requests
1313
def GetAuthenticationParameters: (?String? token) -> Hash[Symbol, (String | Integer)]

0 commit comments

Comments
 (0)