모듈: Mongoid::Extensions::Set::ClassMethods
- 다음에 정의됨:
- lib/mongoid/extensions/ 설정하다.rb
인스턴스 메서드 요약 접기
-
#demongoize(객체) ⇒ 설정
객체를 mongo 친화적인 Ruby 유형에서 이 유형으로 변환합니다.
-
#mongoize(객체) ⇒ 배열 | nil
객체를 처리하는 Ruby 유형에서 mongo 친화적인 유형으로 바꿉니다.
인스턴스 메서드 세부 정보
#demongoize(객체) ⇒ 설정
객체를 mongo 친화적인 Ruby 유형에서 이 유형으로 변환합니다.
39 40 41 42 43 44 |
# 파일 'lib/mongoid/extensions/ 설정하다.rb', 줄 39 def demongoize(객체) case 객체 when ::세트 then 객체 when ::배열 then ::세트.신규(객체) end end |
#mongoize(객체) ⇒ 배열 | nil
객체를 처리하는 Ruby 유형에서 mongo 친화적인 유형으로 바꿉니다.
55 56 57 58 59 60 61 |
# 파일 'lib/mongoid/extensions/ 설정하다.rb', 줄 55 def mongoize(객체) 반환 만약 객체.nil? case 객체 when ::세트 then ::배열.mongoize(객체.to_a).uniq when ::배열 then ::배열.mongoize(객체).uniq end end |