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.



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

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.



5
6
7
# File 'lib/remove_bg/result_metadata.rb', line 5

def credits_charged
  @credits_charged
end

#heightObject (readonly)

Returns the value of attribute height.



5
6
7
# File 'lib/remove_bg/result_metadata.rb', line 5

def height
  @height
end

#typeObject (readonly)

Returns the value of attribute type.



5
6
7
# File 'lib/remove_bg/result_metadata.rb', line 5

def type
  @type
end

#widthObject (readonly)

Returns the value of attribute width.



5
6
7
# File 'lib/remove_bg/result_metadata.rb', line 5

def width
  @width
end