Class: RemoveBg::ResultMetadata
- Inherits:
-
Object
- Object
- RemoveBg::ResultMetadata
- Defined in:
- lib/remove_bg/result_metadata.rb
Instance Attribute Summary collapse
-
#credits_charged ⇒ Object
readonly
Returns the value of attribute credits_charged.
-
#height ⇒ Object
readonly
Returns the value of attribute height.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#width ⇒ Object
readonly
Returns the value of attribute width.
Instance Method Summary collapse
-
#initialize(headers) ⇒ ResultMetadata
constructor
A new instance of ResultMetadata.
Constructor Details
#initialize(headers) ⇒ ResultMetadata
Returns a new instance of ResultMetadata.
9 10 11 12 13 14 |
# File 'lib/remove_bg/result_metadata.rb', line 9 def initialize(headers) @type = headers["X-Type"] @width = headers["X-Width"]&.to_i @height = headers["X-Height"]&.to_i @credits_charged = headers["X-Credits-Charged"]&.to_f end |
Instance Attribute Details
#credits_charged ⇒ Object (readonly)
Returns the value of attribute credits_charged.
7 8 9 |
# File 'lib/remove_bg/result_metadata.rb', line 7 def credits_charged @credits_charged end |
#height ⇒ Object (readonly)
Returns the value of attribute height.
7 8 9 |
# File 'lib/remove_bg/result_metadata.rb', line 7 def height @height end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
7 8 9 |
# File 'lib/remove_bg/result_metadata.rb', line 7 def type @type end |
#width ⇒ Object (readonly)
Returns the value of attribute width.
7 8 9 |
# File 'lib/remove_bg/result_metadata.rb', line 7 def width @width end |