Sha256: 9d9672addfcb70e21df6ff845d223d5cf95ac3cf7fde475b54ccc35419183b5f

Contents?: true

Size: 1.18 KB

Versions: 1

Compression:

Stored size: 1.18 KB

Contents

module Shutterstock
	class ImageSizeDetails < Driver
    attr_reader :hash, :height, :width, :file_size, :display_name, :dpi, :format, :is_licensable

     # {"display_name":"Huge","dpi":300,"file_size":1103872,"format":"jpg","height":5000,"is_licensable":false,"width":5000}

		def initialize(params = {})
      @hash                       = params
      @height                     = params["height"].to_i if params["height"]       # (integer, optional),
      @width                      = params["width"].to_i if params["width"]         # (integer, optional),
      @file_size                  = params["file_size"].to_i if params["file_size"] # (integer, optional),
      @display_name               = params["display_name"]                          # (string, optional),
      @dpi                        = params["dpi"].to_i if params["dpi"]             # (integer, optional),
      @format                     = params["format"]                                # (string, optional),
      @is_licensable              = json_true? params["is_licensable"]              # (boolean, optional)
    end

    alias_method :name, :display_name

    def licensable?
      @is_licensable
    end


	end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
shutterstock-v2-0.0.1 lib/client/image_size_details.rb