Module: Connect::WebService::ConnectParameters::ParamsFactory

Included in:
Rest
Defined in:
lib/connect/web_service/connect_parameters/params_factory.rb

Instance Method Summary collapse

Instance Method Details

#create_changed_from(options) ⇒ Object



13
14
15
16
17
18
# File 'lib/connect/web_service/connect_parameters/params_factory.rb', line 13

def create_changed_from(options)
  create_date_time(
    name: 'ChangedFrom',
    content: options[:content]
  )
end

#create_date(options) ⇒ Object



40
41
42
43
44
45
46
# File 'lib/connect/web_service/connect_parameters/params_factory.rb', line 40

def create_date(options)
  create_parameter(
    name: options[:name],
    type: 'xs:date',
    content: options[:content]
  )
end

#create_date_time(options) ⇒ Object



20
21
22
23
24
25
26
27
28
29
30
# File 'lib/connect/web_service/connect_parameters/params_factory.rb', line 20

def create_date_time(options)
  content = nil
  if options[:content]
    content = options[:content].strftime('%Y-%m-%dT%H:%M:%S')
  end
  create_parameter(
    name: options[:name],
    type: 'xs:dateTime',
    content: content
  )
end

#create_parameter(options) ⇒ Object



7
8
9
10
11
# File 'lib/connect/web_service/connect_parameters/params_factory.rb', line 7

def create_parameter(options)
  property = ConnectProperty.new(options[:name])
  value = ConnectValue.new(options[:type], options[:content])
  ConnectParameter.new(property, value)
end

#create_string(options) ⇒ Object



32
33
34
35
36
37
38
# File 'lib/connect/web_service/connect_parameters/params_factory.rb', line 32

def create_string(options)
  create_parameter(
    name: options[:name],
    type: 'xs:string',
    content: options[:content]
  )
end