Class: Imgix::Style
- Inherits:
-
Object
- Object
- Imgix::Style
- Defined in:
- lib/imgix/style.rb
Constant Summary collapse
- VALID_PARAMS =
[:auto, :bg, :blend, :blendalign, :blendalpha, :blendcrop, :blendfit, :blendheight, :blendmode, :blendpadding, :blendsize, :blendwidth, :blur, :border, :bri, :colors, :con, :crop, :dl, :dpr, :exp, :fit, :flip, :fm, :gam, :h, :high, :htn, :hue, :invert, :mark, :markalign, :markfit, :markh, :markpad, :markscale, :markw, :mask, :mono, :nr, :nrs, :or, :page, :palette, :prefix, :px, :q, :rect, :rot, :sat, :sepia, :shad, :sharp, :txt, :txtalign, :txtclip, :txtclr, :txtfit, :txtfont, :txtline, :txtlineclr, :txtpad, :txtshad, :txtsize, :txtwidth, :vib, :w]
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(name, attachment, options = {}) ⇒ Style
constructor
A new instance of Style.
- #to_s ⇒ Object
Constructor Details
#initialize(name, attachment, options = {}) ⇒ Style
Returns a new instance of Style.
15 16 17 18 19 20 21 22 |
# File 'lib/imgix/style.rb', line 15 def initialize(name, , = {}) @name = name @attachment = @options = if @options.is_a?(Hash) @options = @options.delete_if {|k, v| !Imgix::Style.is_param_valid?(k) } end end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/imgix/style.rb', line 3 def name @name end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
3 4 5 |
# File 'lib/imgix/style.rb', line 3 def @options end |
Class Method Details
.is_param_valid?(param) ⇒ Boolean
28 29 30 |
# File 'lib/imgix/style.rb', line 28 def self.is_param_valid?(param) VALID_PARAMS.include?(param.to_sym) end |
Instance Method Details
#to_s ⇒ Object
24 25 26 |
# File 'lib/imgix/style.rb', line 24 def to_s self..to_param end |