Module: Persistence::Object::Complex::Attributes::AttributesArray

Defined in:
lib/persistence/object/complex/attributes/attributes_array.rb

Overview

Module used for common methods for attributes arrays.

Instance Method Summary collapse

Instance Method Details

#has_attributes?(attribute_name, ...) ⇒ true, false

Query whether this array includes attribute(s).

Parameters:

  • attribute_name (Symbol, String)

    Attribute to query.

Returns:

  • (true, false)

    Whether this hash/array includes attribute(s).



20
21
22
23
24
25
26
27
28
29
30
# File 'lib/persistence/object/complex/attributes/attributes_array.rb', line 20

def has_attributes?( *attributes )
  
  has_attributes = false

  attributes.each do |this_attribute|
    break unless has_attributes = include?( this_attribute )
  end

  return has_attributes
  
end