Sha256: eaf9b19d50de6585189835a3e06ef7824713720d233fd92fdd7b3df3bd9da31c

Contents?: true

Size: 727 Bytes

Versions: 1

Compression:

Stored size: 727 Bytes

Contents

class ProductDataSource < TestCentricity::DataSource
  def find_product(product_id)
    ProductData.current = ProductData.new(environs.read('Products', product_id.to_i))
  end
end


class ProductData < TestCentricity::DataPresenter
  attribute :id, Integer
  attribute :name, String
  attribute :description, String
  attribute :price, String
  attribute :review, Integer
  attribute :colors, Array
  attribute :default_color, String

  def initialize(data)
    @id            = data[:id]
    @name          = data[:name]
    @description   = data[:description]
    @price         = data[:price]
    @review        = data[:review]
    @colors        = data[:colors]
    @default_color = data[:defaultColor]
    super
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
testcentricity-3.0.4 features/support/data/product_data.rb