Class: YDIM::Html::State::Invoice::SortableInvoice

Inherits:
Object
  • Object
show all
Defined in:
lib/ydim/html/state/invoice.rb

Instance Method Summary collapse

Constructor Details

#initialize(invoice) ⇒ SortableInvoice

Returns a new instance of SortableInvoice.



56
57
58
# File 'lib/ydim/html/state/invoice.rb', line 56

def initialize invoice
  @invoice = invoice
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args, &block) ⇒ Object



74
75
76
# File 'lib/ydim/html/state/invoice.rb', line 74

def method_missing name, *args, &block
  @invoice.send name, *args, &block
end

Instance Method Details

#itemsObject



59
60
61
# File 'lib/ydim/html/state/invoice.rb', line 59

def items
  @items ||= @invoice.items
end

#respond_to?(*args) ⇒ Boolean

Returns:

  • (Boolean)


65
66
67
# File 'lib/ydim/html/state/invoice.rb', line 65

def respond_to? *args
  @invoice.respond_to?(*args) || super
end

#reverse!Object



62
63
64
# File 'lib/ydim/html/state/invoice.rb', line 62

def reverse!
  items.reverse!
end

#sort!(&block) ⇒ Object



68
69
70
# File 'lib/ydim/html/state/invoice.rb', line 68

def sort! &block
  items.sort! &block
end

#update!Object



71
72
73
# File 'lib/ydim/html/state/invoice.rb', line 71

def update!
  @items = nil
end