Class: Eluka::Features
- Inherits:
-
Object
- Object
- Eluka::Features
- Defined in:
- lib/eluka/features.rb
Instance Attribute Summary collapse
-
#f_count ⇒ Object
readonly
Returns the value of attribute f_count.
Instance Method Summary collapse
- #add(term) ⇒ Object
- #id(term) ⇒ Object
-
#initialize ⇒ Features
constructor
A new instance of Features.
- #term(id) ⇒ Object
Constructor Details
Instance Attribute Details
#f_count ⇒ Object (readonly)
Returns the value of attribute f_count.
10 11 12 |
# File 'lib/eluka/features.rb', line 10 def f_count @f_count end |
Instance Method Details
#add(term) ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/eluka/features.rb', line 12 def add (term) unless @features[term] then @f_count += 1 @features[term] = @f_count end return @features[term] end |
#id(term) ⇒ Object
20 21 22 |
# File 'lib/eluka/features.rb', line 20 def id (term) @features[term] end |
#term(id) ⇒ Object
24 25 26 |
# File 'lib/eluka/features.rb', line 24 def term (id) @features.lookup(id) end |