Sha256: c99113cf3c9d5fe7c25a350c41b45b294f696d6ae04e0f3b8a2e21a6f039d6fc

Contents?: true

Size: 617 Bytes

Versions: 1

Compression:

Stored size: 617 Bytes

Contents

# frozen_string_literal: true

require 'bigdecimal'
require 'time'

module Kentaa
  module Api
    module Resources
      class Product
        attr_reader :data

        def initialize(data)
          @data = data
        end

        def id
          data[:id]
        end

        def title
          data[:title]
        end

        def variant_id
          data[:variant_id]
        end

        def variant_title
          data[:variant_title]
        end

        def price
          BigDecimal(data[:price])
        end

        def currency
          data[:currency]
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
kentaa-api-0.8.0 lib/kentaa/api/resources/product.rb