Class: Naviance::Staff

Inherits:
Object
  • Object
show all
Defined in:
lib/naviance/staff.rb

Instance Attribute Summary (collapse)

Class Method Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (Staff) initialize(params)

:nodoc:



4
5
6
7
8
9
# File 'lib/naviance/staff.rb', line 4

def initialize(params) # :nodoc:
  @id = params['naviance_staff_id']
  @school_id = params['naviance_school_id']
  @first_name = params['first_name']
  @last_name = params['last_name']
end

Instance Attribute Details

- (Object) first_name (readonly)

Returns the value of attribute first_name



2
3
4
# File 'lib/naviance/staff.rb', line 2

def first_name
  @first_name
end

- (Object) id (readonly)

Returns the value of attribute id



2
3
4
# File 'lib/naviance/staff.rb', line 2

def id
  @id
end

- (Object) last_name (readonly)

Returns the value of attribute last_name



2
3
4
# File 'lib/naviance/staff.rb', line 2

def last_name
  @last_name
end

- (Object) school_id (readonly)

Returns the value of attribute school_id



2
3
4
# File 'lib/naviance/staff.rb', line 2

def school_id
  @school_id
end

Class Method Details

+ (Object) find(env, access_token, id)

Get Staff data from Naviance

Attributes

  • env - The environment you are working in sandbox or production. Also accepts corresponding Rails.env

  • access_token - A valid access token see Naviance::AccessToken#get

  • id - The Naviance ID of the Staff member



18
19
20
# File 'lib/naviance/staff.rb', line 18

def self.find(env, access_token, id)
  Naviance.fetch(env, access_token, id, 'student')
end