```ruby
class ShippingRate < Struct.new(:id, :shipping_method, :name, :cost)
  def initialize(attributes={})
    attributes.each do |k,v|
      self.send("#{k}=", v)
    end
  end

end
```

Make sure shipping rate is within Spree module
user
```ruby
module Spree
  class ShippingRate < Struct.new(:id, :shipping_method, :name, :cost)
    def initialize(attributes={})
      attributes.each do |k,v|
        self.send("#{k}=", v)
      end
    end
  end
end
```
assistant