Class: Enum::Term

Inherits:
Object
  • Object
show all
Defined in:
app/support/enum.rb

Instance Method Summary collapse

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

#idObject



9
10
11
# File 'app/support/enum.rb', line 9

def id
  @term
end

#to_labelObject



13
14
15
# File 'app/support/enum.rb', line 13

def to_label
  I18n.t(@term, :scope => @scope, :default => @term.to_s.humanize)
end