Class: Sipwizard::Relation

Inherits:
Object
  • Object
show all
Defined in:
lib/sipwizard/relation.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeRelation

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

#relationObject (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