Class: Confetti::Config::Image
- Inherits:
-
Object
- Object
- Confetti::Config::Image
- Defined in:
- lib/confetti/config/image.rb
Instance Attribute Summary collapse
-
#density ⇒ Object
Returns the value of attribute density.
-
#extras ⇒ Object
Returns the value of attribute extras.
-
#height ⇒ Object
Returns the value of attribute height.
-
#keep_original ⇒ Object
Returns the value of attribute keep_original.
-
#main ⇒ Object
Returns the value of attribute main.
-
#platform ⇒ Object
Returns the value of attribute platform.
-
#role ⇒ Object
Returns the value of attribute role.
-
#src ⇒ Object
Returns the value of attribute src.
-
#state ⇒ Object
Returns the value of attribute state.
-
#width ⇒ Object
Returns the value of attribute width.
Instance Method Summary collapse
- #defined_attrs ⇒ Object
-
#initialize(*args) ⇒ Image
constructor
A new instance of Image.
Constructor Details
#initialize(*args) ⇒ Image
Returns a new instance of Image.
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/confetti/config/image.rb', line 7 def initialize *args @src = args.shift @height = args.shift @width = args.shift @extras = (args.shift || {}).reject do |name, val| %w{src height width}.include?(name) end @role = @extras['role'] @platform = @extras['platform'] @main = @extras['main'] @density = @extras['density'] @state = @extras['state'] @keep_original = @extras['keepOriginal'] end |
Instance Attribute Details
#density ⇒ Object
Returns the value of attribute density.
4 5 6 |
# File 'lib/confetti/config/image.rb', line 4 def density @density end |
#extras ⇒ Object
Returns the value of attribute extras.
4 5 6 |
# File 'lib/confetti/config/image.rb', line 4 def extras @extras end |
#height ⇒ Object
Returns the value of attribute height.
4 5 6 |
# File 'lib/confetti/config/image.rb', line 4 def height @height end |
#keep_original ⇒ Object
Returns the value of attribute keep_original.
4 5 6 |
# File 'lib/confetti/config/image.rb', line 4 def keep_original @keep_original end |
#main ⇒ Object
Returns the value of attribute main.
4 5 6 |
# File 'lib/confetti/config/image.rb', line 4 def main @main end |
#platform ⇒ Object
Returns the value of attribute platform.
4 5 6 |
# File 'lib/confetti/config/image.rb', line 4 def platform @platform end |
#role ⇒ Object
Returns the value of attribute role.
4 5 6 |
# File 'lib/confetti/config/image.rb', line 4 def role @role end |
#src ⇒ Object
Returns the value of attribute src.
4 5 6 |
# File 'lib/confetti/config/image.rb', line 4 def src @src end |
#state ⇒ Object
Returns the value of attribute state.
4 5 6 |
# File 'lib/confetti/config/image.rb', line 4 def state @state end |
#width ⇒ Object
Returns the value of attribute width.
4 5 6 |
# File 'lib/confetti/config/image.rb', line 4 def width @width end |
Instance Method Details
#defined_attrs ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/confetti/config/image.rb', line 24 def defined_attrs { "src" => @src, "height" => @height, "width" => @width, "gap:role" => @role, "gap:platform" => @platform, "gap:main" => @main, "gap:density" => @density, "gap:state" => @state, "gap:keepOriginal" => @keep_original } end |