class Mingle::MingleList

Public Class Methods

new( obj ) click to toggle source
# File lib/mingle.rb, line 403
def initialize( obj )
    @arr = obj.map { |elt| MingleModels.as_mingle_value( elt ) }.freeze
end

Public Instance Methods

+( coll ) click to toggle source
# File lib/mingle.rb, line 424
def +( coll )
    
    not_nil( coll, :coll )

    case coll

        when MingleList 
            MingleList.new( @arr + coll.instance_variable_get( :@arr ) )

        when Array then self + MingleList.new( coll )

        else 
            raise "Operation '+' not supported for objects of " \
                  "type #{coll.class}"
    end
end
==( other ) click to toggle source
# File lib/mingle.rb, line 418
def ==( other )
    other.is_a?( MingleList ) &&
        other.instance_variable_get( :@arr ) == @arr
end
to_a() click to toggle source
# File lib/mingle.rb, line 413
def to_a
    Array.new( @arr )
end
to_s() click to toggle source
# File lib/mingle.rb, line 408
def to_s
    @arr.to_s
end