Class: Playapi::Picking

Inherits:
Feature show all
Extended by:
Utils
Defined in:
lib/playapi/picking.rb

Instance Attribute Summary collapse

Attributes inherited from Feature

#attrs, #campaign_id, #default_points, #id, #live, #name

Instance Method Summary collapse

Methods included from Utils

hi

Methods inherited from Feature

#campaign, create, #destroy, destroy, find_by_facet, get, #interactions, list, #push, update

Methods inherited from Identity

#==, fetch, #id, #initialize, store

Methods inherited from Base

#[], attr_reader, #attrs, fetch, fetch_or_new, from_response, identity_map, #initialize, store, #update

Constructor Details

This class inherits a constructor from Playapi::Identity

Instance Attribute Details

#target_classObject (readonly)

Returns the value of attribute target_class.



7
8
9
# File 'lib/playapi/picking.rb', line 7

def target_class
  @target_class
end

#target_featuresObject (readonly)

Returns the value of attribute target_features.



7
8
9
# File 'lib/playapi/picking.rb', line 7

def target_features
  @target_features
end

Instance Method Details

#get_set(set_size = 2, opts = {}) ⇒ Object

gets a set of interactions from a picking feature on playapi



10
11
12
13
14
# File 'lib/playapi/picking.rb', line 10

def get_set(set_size=2, opts={})
	url = "api/v2/picks/#{id}"
	# public and private don't matter since you can use send... :/
	self.class.send(:get_objects, :get, "results", url, opts.merge!(set_size: set_size))
end