Sha256: fd45193fca4649a9c5ed1565e68eeca3d667415c281b88d7b3b38f9cb08c01b1

Contents?: true

Size: 251 Bytes

Versions: 9

Compression:

Stored size: 251 Bytes

Contents

class Label
  attr_reader :response, :name, :data
  def initialize response
    @response = response
    @name = response.dig("nome")
    @data = response.dig("dados")
  end

  def download_file
    File.write(@name, Base64.decode64(@data))
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
correios_api-1.0.3 lib/correios_api/label.rb
correios_api-1.0.2 lib/correios_api/label.rb
correios_api-1.0.1 lib/correios_api/label.rb
correios_api-1.0.0 lib/correios_api/label.rb
correios_api-0.5.0 lib/correios_api/label.rb
correios_api-0.4.0 lib/correios_api/label.rb
correios_api-0.3.0 lib/correios_api/label.rb
correios_api-0.2.0 lib/correios_api/label.rb
correios_api-0.1.0 lib/correios_api/label.rb