开发者

Ruby OOP terminology: How do you call "devise" and ":trackable" in this class?

开发者 https://www.devze.com 2023-04-10 04:38 出处:网络
Here is a Ruby ActiveRecord class: class User < ActiveRecord::Base has_many :user_tokens devise :tracka开发者_如何转开发ble, :confirmable

Here is a Ruby ActiveRecord class:

class User < ActiveRecord::Base
  has_many :user_tokens
  devise :tracka开发者_如何转开发ble, :confirmable

I have two Ruby terminology questions about it:

  1. How do you call :confirmable, is it an "aspect" of class User?
  2. In the code above, how do you call the devise word? Is it a "method call"?

PS: I am quite new to Ruby. I have searched online, and read many Ruby OOP tutorials, but none gave those two things a proper name.


devise is a method call, it could be either a class or instance method, I'm not sure. I think here it is best to refer to :confirmable as an argument which is passed to the devise method. You'd best refer to the devise docs for a better understanding of what its role is.


Devise is a class method, correct. Confirmable is either a method, or an attribute, or both-not sure how devise implements it.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号