Class: Plok::Search::Term
- Inherits:
-
Object
- Object
- Plok::Search::Term
- Defined in:
- lib/plok/search/term.rb
Instance Attribute Summary collapse
-
#controller ⇒ Object
readonly
Returns the value of attribute controller.
-
#string ⇒ Object
readonly
Returns the value of attribute string.
Instance Method Summary collapse
-
#initialize(string, controller: nil) ⇒ Term
constructor
A new instance of Term.
- #locale ⇒ Object
- #valid? ⇒ Boolean
- #value ⇒ Object
Constructor Details
#initialize(string, controller: nil) ⇒ Term
Returns a new instance of Term.
5 6 7 8 |
# File 'lib/plok/search/term.rb', line 5 def initialize(string, controller: nil) @string = string @controller = controller end |
Instance Attribute Details
#controller ⇒ Object (readonly)
Returns the value of attribute controller.
3 4 5 |
# File 'lib/plok/search/term.rb', line 3 def controller @controller end |
#string ⇒ Object (readonly)
Returns the value of attribute string.
3 4 5 |
# File 'lib/plok/search/term.rb', line 3 def string @string end |
Instance Method Details
#locale ⇒ Object
10 11 12 13 |
# File 'lib/plok/search/term.rb', line 10 def locale return controller.locale if controller.present? :nl end |
#valid? ⇒ Boolean
15 16 17 |
# File 'lib/plok/search/term.rb', line 15 def valid? @string.present? end |
#value ⇒ Object
19 20 21 |
# File 'lib/plok/search/term.rb', line 19 def value string end |