Class: Notes::Criteria
- Inherits:
-
Object
- Object
- Notes::Criteria
- Defined in:
- lib/notes/model/criteria.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(name, value) ⇒ Criteria
constructor
A new instance of Criteria.
- #to_hash ⇒ Object
Constructor Details
#initialize(name, value) ⇒ Criteria
Returns a new instance of Criteria.
4 5 6 7 |
# File 'lib/notes/model/criteria.rb', line 4 def initialize(name, value) @name = name @value = value end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/notes/model/criteria.rb', line 3 def name @name end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
3 4 5 |
# File 'lib/notes/model/criteria.rb', line 3 def value @value end |
Instance Method Details
#to_hash ⇒ Object
9 10 11 12 13 14 |
# File 'lib/notes/model/criteria.rb', line 9 def to_hash if @value.kind_of? Array return {@name => (Notes::ArrayUtil.array_to_string @value)} end {@name => @value} end |