Class: Enum::Term
- Inherits:
-
Object
- Object
- Enum::Term
- Defined in:
- app/support/enum.rb
Instance Method Summary collapse
- #id ⇒ Object
-
#initialize(scope, term) ⇒ Term
constructor
A new instance of Term.
- #to_label ⇒ Object
Constructor Details
#initialize(scope, term) ⇒ Term
Returns a new instance of Term.
4 5 6 7 |
# File 'app/support/enum.rb', line 4 def initialize(scope, term) @term = term @scope = scope end |
Instance Method Details
#id ⇒ Object
9 10 11 |
# File 'app/support/enum.rb', line 9 def id @term end |
#to_label ⇒ Object
13 14 15 |
# File 'app/support/enum.rb', line 13 def to_label I18n.t(@term, :scope => @scope, :default => @term.to_s.humanize) end |