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
19
20
21
22
23
# File 'lib/connect/web_service/connect_parameters/params_factory.rb', line 13

def create_changed_from(options)
  date = options[:changed_from]
  content = nil
  if date
    content = date.strftime('%Y-%m-%dT%H:%M:%S')
  end
  create_date_time(
    name: 'ChangedFrom',
    content: content
  )
end

#create_date(options) ⇒ Object



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

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

#create_date_time(options) ⇒ Object



25
26
27
28
29
30
31
# File 'lib/connect/web_service/connect_parameters/params_factory.rb', line 25

def create_date_time(options)
  create_parameter(
    name: options[:name],
    type: 'xs:dateTime',
    content: options[: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



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

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