Class: ViewModel::ActiveRecord::UpdateOperation::ReferencedCollectionMember

Inherits:
Object
  • Object
show all
Defined in:
lib/view_model/active_record/update_operation.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(indirect_viewmodel_reference, direct_viewmodel) ⇒ ReferencedCollectionMember

Returns a new instance of ReferencedCollectionMember.



650
651
652
653
654
655
656
# File 'lib/view_model/active_record/update_operation.rb', line 650

def initialize(indirect_viewmodel_reference, direct_viewmodel)
  @indirect_viewmodel_reference = indirect_viewmodel_reference
  @direct_viewmodel             = direct_viewmodel
  if direct_viewmodel.class._list_member?
    @position = direct_viewmodel._list_attribute
  end
end

Instance Attribute Details

#direct_viewmodelObject (readonly)

Returns the value of attribute direct_viewmodel.



647
648
649
# File 'lib/view_model/active_record/update_operation.rb', line 647

def direct_viewmodel
  @direct_viewmodel
end

#indirect_viewmodel_referenceObject (readonly)

Returns the value of attribute indirect_viewmodel_reference.



647
648
649
# File 'lib/view_model/active_record/update_operation.rb', line 647

def indirect_viewmodel_reference
  @indirect_viewmodel_reference
end

#positionObject

Returns the value of attribute position.



648
649
650
# File 'lib/view_model/active_record/update_operation.rb', line 648

def position
  @position
end

#ref_stringObject

Returns the value of attribute ref_string.



648
649
650
# File 'lib/view_model/active_record/update_operation.rb', line 648

def ref_string
  @ref_string
end

Instance Method Details

#==(other) ⇒ Object Also known as: eql?



658
659
660
661
# File 'lib/view_model/active_record/update_operation.rb', line 658

def ==(other)
  other.class == self.class &&
    other.indirect_viewmodel_reference == self.indirect_viewmodel_reference
end