Class: AdobeConnectApi::FilterDefinition

Inherits:
Object
  • Object
show all
Defined in:
lib/adobe_connect_api/filter_definition.rb

Overview

A filter definition can be added to some actions to filter the results server-side. Example: filter = AdobeConnectAPI::FilterDefinition.new filter.greater_than 25 filter <= Time.now

Defined Under Namespace

Classes: Field

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeFilterDefinition

Returns a new instance of FilterDefinition.



12
13
14
# File 'lib/adobe_connect_api/filter_definition.rb', line 12

def initialize
  @fields = Hash.new
end

Instance Attribute Details

#is_memberObject

Returns the value of attribute is_member.



10
11
12
# File 'lib/adobe_connect_api/filter_definition.rb', line 10

def is_member
  @is_member
end

#rowsObject

Returns the value of attribute rows.



8
9
10
# File 'lib/adobe_connect_api/filter_definition.rb', line 8

def rows
  @rows
end

#startObject

Returns the value of attribute start.



9
10
11
# File 'lib/adobe_connect_api/filter_definition.rb', line 9

def start
  @start
end

Instance Method Details

#[](field_name) ⇒ Object



16
17
18
19
20
21
22
23
# File 'lib/adobe_connect_api/filter_definition.rb', line 16

def [](field_name)
  field = @fields[field_name]
  if field == nil
    field = AdobeConnectApi::FilterDefinition::Field.new(field_name)
    @fields[field_name] = field
  end
  return field
end

#queryObject



25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/adobe_connect_api/filter_definition.rb', line 25

def query
  string = ""

  if @rows != nil
    string += "&filter-rows=" + "#{@rows}"
  end
  if @start != nil
    string += "&filter-start=" + "#{@start}"
  end
  if @is_member != nil
    if @is_member
      string += "&filter-is-member=true"
    else
      string += "&filter-is-member=false"
    end
  end

  @fields.each_pair do |name, f|
    string += f.query
  end
  return string
end