4
가능한 중복 :
나는 이런 식으로 뭔가하고 싶은
Calling a Function From a String With the Function's Name in Ruby레일 - 변수 메소드 이름의 한 부분으로
: 나는이 얻을 수있는 방법
def self.greater_than(col_str='events')
self."#{col_str}"_greater_than(30) # search logic scope method
end
을 제대로 부르세요? 구문을 추측하는 것은 아마도 동적 메서드를 만드는 것과 비슷할 것입니다.