Sha256: abd6f0931dcd5fba6e9484faa2fbbfaa2fa158e8755fb5d88a0615f0fd760b29

Contents?: true

Size: 253 Bytes

Versions: 3

Compression:

Stored size: 253 Bytes

Contents

module ShoppingCart
  class AddCouponGenerator < Rails::Generators::Base

    argument :code, type: :string
    argument :discount, type: :string

    def create_coupon
      ShoppingCart::Coupon.create code: code, discount: discount
    end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
shopping-cart-0.1.2 lib/generators/shopping_cart/add_coupon/add_coupon_generator.rb
shopping-cart-0.1.1 lib/generators/shopping_cart/add_coupon/add_coupon_generator.rb
shopping-cart-0.1.0 lib/generators/shopping_cart/add_coupon/add_coupon_generator.rb