Class: RemoveBg::ResultMetadata

Inherits:
Object
  • Object
show all
Defined in:
lib/remove_bg/result_metadata.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_chargedObject (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

#heightObject (readonly)

Returns the value of attribute height.



7
8
9
# File 'lib/remove_bg/result_metadata.rb', line 7

def height
  @height
end

#typeObject (readonly)

Returns the value of attribute type.



7
8
9
# File 'lib/remove_bg/result_metadata.rb', line 7

def type
  @type
end

#widthObject (readonly)

Returns the value of attribute width.



7
8
9
# File 'lib/remove_bg/result_metadata.rb', line 7

def width
  @width
end