Class: RailsDominantColors::Path
- Defined in:
- lib/rails_dominant_colors/path.rb
Constant Summary
Constants inherited from Base
Base::EmptySource, Base::FileNotFound, Base::InvalidBase64, Base::InvalidUrl, Base::NotAnImage, Base::UrlNotFound
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(source, colors) ⇒ Path
constructor
A new instance of Path.
Methods inherited from Base
#to_hex, #to_hex_alpha, #to_hsl, #to_hsl_alpha, #to_pct, #to_rgb, #to_rgb_alpha
Constructor Details
#initialize(source, colors) ⇒ Path
Returns a new instance of Path.
5 6 7 8 9 10 11 |
# File 'lib/rails_dominant_colors/path.rb', line 5 def initialize(source, colors) raise(EmptySource) if source.nil? || source.empty? raise(FileNotFound) unless file_exist?(source) raise(NotAnImage) unless file_is_image?(source) super(source, colors) end |