Class: Pathname
- Inherits:
-
Object
- Object
- Pathname
- Defined in:
- lib/KCommercialPipeline/core/resource/bundle/scale_pathname.rb
Instance Method Summary collapse
Instance Method Details
#filename_without_scale ⇒ Object
4 5 6 7 8 9 10 11 |
# File 'lib/KCommercialPipeline/core/resource/bundle/scale_pathname.rb', line 4 def filename_without_scale name = basename('.*').to_s if name.match? /.*@[123][xX]/ index = name.rindex('@') name = name[..(index - 1)] end name end |
#xcasset_scale ⇒ Object
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/KCommercialPipeline/core/resource/bundle/scale_pathname.rb', line 13 def xcasset_scale name = basename('.*') match_data = name.match? /.*@[123][xX]/ if match_data scale = match_data.captures.first scale.downcase else nil end end |