Class: Sipwizard::Relation
- Inherits:
-
Object
- Object
- Sipwizard::Relation
- Defined in:
- lib/sipwizard/relation.rb
Instance Attribute Summary collapse
-
#relation ⇒ Object
readonly
Returns the value of attribute relation.
Instance Method Summary collapse
- #count(nb) ⇒ Object
-
#initialize ⇒ Relation
constructor
A new instance of Relation.
- #where(params) ⇒ Object
Constructor Details
#initialize ⇒ Relation
Returns a new instance of Relation.
5 6 7 |
# File 'lib/sipwizard/relation.rb', line 5 def initialize @relation = Hashie::Clash.new end |
Instance Attribute Details
#relation ⇒ Object (readonly)
Returns the value of attribute relation.
3 4 5 |
# File 'lib/sipwizard/relation.rb', line 3 def relation @relation end |
Instance Method Details
#count(nb) ⇒ Object
14 15 16 17 |
# File 'lib/sipwizard/relation.rb', line 14 def count(nb) @relation.merge!({count: nb}) self end |
#where(params) ⇒ Object
9 10 11 12 |
# File 'lib/sipwizard/relation.rb', line 9 def where(params) @relation.where( hash_to_query(params) ) self end |