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:
- How do you call
:confirmable
, is it an "aspect" of class User? - 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.
精彩评论