def extract_profile(args)
      return args.shift if args.first.is_a?(Management::Profile)
      return args.pop if args.last.is_a?(Management::Profile)
      profile
    end
def extract_profile(args)
      return args.shift if args.first.is_a?(Management::Profile)
      return args.pop if args.last.is_a?(Management::Profile)
      profile
    end
def apply_filter_options(filter_options)
   join_character = Legato.and_join_character

   Array.wrap(filter_options).compact.each do |filter|
     filter.each do |key, value|
       self.filters << hash_to_filter(key, value, join_character)
       join_character = Legato.and_join_character # hashes are joined by AND
     end
     join_character = Legato.or_join_character # arrays are joined by OR
   end
 end
 def hash_to_filter(key, value, join_character)
   field, operator = key, :eql
   field, operator = key.target, key.operator if key.is_a?(SymbolOperatorMethods)
   Filter.new(field, operator, value, join_character)
 end