Module: Icss::ReceiverModel::ActsAsTuple

Included in:
Icss::ReceiverModel
Defined in:
lib/icss/receiver_model/acts_as_tuple.rb

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



97
# File 'lib/icss/receiver_model/acts_as_tuple.rb', line 97

def self.included(base) base.extend(Icss::ReceiverModel::ActsAsTuple::ClassMethods) ; end

Instance Method Details

#to_tupleObject



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/icss/receiver_model/acts_as_tuple.rb', line 5

def to_tuple
  tuple = []
  self.each_value do |val|
    if val.respond_to?(:to_tuple)
      tuple += val.to_tuple
    else
      tuple << val
    end
  end
  tuple
end