Class: TinCanApi::StatementsQuery

Inherits:
Object
  • Object
show all
Defined in:
lib/tin_can_api/statements_query.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(&block) ⇒ StatementsQuery

Returns a new instance of StatementsQuery.



9
10
11
12
13
14
# File 'lib/tin_can_api/statements_query.rb', line 9

def initialize(&block)
  self.version = TCAPIVersion::V101
  if block_given?
    block[self]
  end
end

Instance Attribute Details

#activity_idObject

Returns the value of attribute activity_id.



6
7
8
# File 'lib/tin_can_api/statements_query.rb', line 6

def activity_id
  @activity_id
end

#agentObject

Returns the value of attribute agent.



6
7
8
# File 'lib/tin_can_api/statements_query.rb', line 6

def agent
  @agent
end

#ascendingObject

Returns the value of attribute ascending.



7
8
9
# File 'lib/tin_can_api/statements_query.rb', line 7

def ascending
  @ascending
end

#formatObject

Returns the value of attribute format.



7
8
9
# File 'lib/tin_can_api/statements_query.rb', line 7

def format
  @format
end

#limitObject

Returns the value of attribute limit.



7
8
9
# File 'lib/tin_can_api/statements_query.rb', line 7

def limit
  @limit
end

#registrationObject

Returns the value of attribute registration.



6
7
8
# File 'lib/tin_can_api/statements_query.rb', line 6

def registration
  @registration
end

Returns the value of attribute related_activities.



6
7
8
# File 'lib/tin_can_api/statements_query.rb', line 6

def related_activities
  @related_activities
end

Returns the value of attribute related_agents.



6
7
8
# File 'lib/tin_can_api/statements_query.rb', line 6

def related_agents
  @related_agents
end

#stored_sinceObject

Returns the value of attribute stored_since.



7
8
9
# File 'lib/tin_can_api/statements_query.rb', line 7

def stored_since
  @stored_since
end

#stored_untilObject

Returns the value of attribute stored_until.



7
8
9
# File 'lib/tin_can_api/statements_query.rb', line 7

def stored_until
  @stored_until
end

#verb_idObject

Returns the value of attribute verb_id.



5
6
7
# File 'lib/tin_can_api/statements_query.rb', line 5

def verb_id
  @verb_id
end

#versionObject (readonly)

Returns the value of attribute version.



5
6
7
# File 'lib/tin_can_api/statements_query.rb', line 5

def version
  @version
end

Instance Method Details

#parameter_mapObject



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/tin_can_api/statements_query.rb', line 24

def parameter_map
  params = {}
  params['agent'] = agent.serialize(version) if agent
  params['verb'] = verb_id.to_s if verb_id
  params['activity'] = activity_id.to_s if activity_id
  params['registration'] = registration if registration
  params['related_activities'] = related_activities if related_activities
  params['related_agents'] = related_agents if related_agents
  params['since'] = stored_since.strftime('%FT%T%:z') if stored_since
  params['until'] = stored_until.strftime('%FT%T%:z') if stored_until
  params['limit'] = limit if limit
  params['format'] = format if format
  params['ascending'] = ascending if ascending

  params
end