Class: CFoundry::V2::ModelMagic::QueryValueHelper::QueryMultiValue

Inherits:
Object
  • Object
show all
Defined in:
lib/cfoundry/v2/model_magic/query_multi_value_helper.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*query_hashes) ⇒ QueryMultiValue

Returns a new instance of QueryMultiValue.



7
8
9
10
11
# File 'lib/cfoundry/v2/model_magic/query_multi_value_helper.rb', line 7

def initialize(*query_hashes)
  self.query_values = query_hashes.collect do |query_hash|
    QueryValue.new query_hash
  end
end

Instance Attribute Details

#query_valuesObject

Returns the value of attribute query_values.



5
6
7
# File 'lib/cfoundry/v2/model_magic/query_multi_value_helper.rb', line 5

def query_values
  @query_values
end

Instance Method Details

#collect_values(key) ⇒ Object



13
14
15
16
17
# File 'lib/cfoundry/v2/model_magic/query_multi_value_helper.rb', line 13

def collect_values(key)
  query_values.collect do |value|
    "#{key}#{value}"
  end.join(';')
end