Class: Viadeo::ReferenceData

Inherits:
GraphObject show all
Includes:
Operations::List
Defined in:
lib/viadeo/reference_data.rb

Overview

List of actions

  • all : Also aliased as : list

List of resources

Example :

require "viadeo"

# Retrieve reference list of languages and limit the result to 5
reference_data = Viadeo::ReferenceData.new(access_token, resource: "language")
reference_data.all(limit: 5)

WARNING: if it called without resource parameter it raise MissingResourceError

Instance Attribute Summary

Attributes inherited from GraphObject

#access_token, #id

Instance Method Summary collapse

Methods included from Operations::List

#all

Methods inherited from GraphObject

#[], #[]=, #data_to_graph_object, #each, #inspect, #keys, new_from, #refresh_from, #reset, #to_hash, #to_json, #to_s, #updated?, #values

Constructor Details

#initialize(access_token, options = {}) ⇒ ReferenceData

Returns a new instance of ReferenceData.



31
32
33
34
35
# File 'lib/viadeo/reference_data.rb', line 31

def initialize(access_token, options={})
  raise Viadeo::MissingResourceError.new("resource parameter is mandatory") unless options[:resource]
  @resource = options[:resource]
  super(access_token, options)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Viadeo::GraphObject