Sha256: 706adfc0820fbad059b665a6908cd4edc5f243d213a65394ab29ae3fd2925519

Contents?: true

Size: 307 Bytes

Versions: 35

Compression:

Stored size: 307 Bytes

Contents

class Return
  attr_accessor :order, :items

  def initialize(order, items)
    self.order = order
    self.items = items
  end

  def submit
    @success = items.map(&:return!).reduce(&:&)
  rescue Transitions::InvalidTransition
    @success = false
  end

  def successful?
    @success || false
  end
end

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
artfully_ose-1.3.0.pre4 app/models/return.rb
artfully_ose-1.3.0.pre3 app/models/return.rb
artfully_ose-1.3.0.pre2 app/models/return.rb
artfully_ose-1.3.0.pre1 app/models/return.rb
artfully_ose-1.2.0 app/models/return.rb
artfully_ose-1.2.0.beta.1 app/models/return.rb
artfully_ose-1.2.0.alpha.2 app/models/return.rb
artfully_ose-1.2.0.alpha.1 app/models/return.rb
artfully_ose-1.2.0.pre.27 app/models/return.rb
artfully_ose-1.2.0.pre.26 app/models/return.rb
artfully_ose-1.2.0.pre.24 app/models/return.rb
artfully_ose-1.2.0.pre.23 app/models/return.rb
artfully_ose-1.2.0.pre.21 app/models/return.rb
artfully_ose-1.2.0.pre.20 app/models/return.rb
artfully_ose-1.2.0.pre.19 app/models/return.rb
artfully_ose-1.2.0.pre.18 app/models/return.rb
artfully_ose-1.2.0.pre.17 app/models/return.rb
artfully_ose-1.2.0.pre.16 app/models/return.rb
artfully_ose-1.2.0.pre.15 app/models/return.rb
artfully_ose-1.2.0.pre.12 app/models/return.rb