ruby入门_类方法

# class
class Person
  # class method
  def Person.Moveable
    return true
  end
end

puts Person.Moveable

输出

true

你可能感兴趣的:(Class,Ruby)