Class: Spark::Team

Inherits:
Base
  • Object
show all
Defined in:
lib/team.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#[], #delete, #refresh, #update

Constructor Details

#initialize(data) ⇒ Team



4
5
6
7
8
# File 'lib/team.rb', line 4

def initialize(data)
    @api_endpoint = 'teams'
    @update_fields = [:name]
    super
end

Instance Attribute Details

#createdObject

Returns the value of attribute created.



3
4
5
# File 'lib/team.rb', line 3

def created
  @created
end

#creatorIdObject

Returns the value of attribute creatorId.



3
4
5
# File 'lib/team.rb', line 3

def creatorId
  @creatorId
end

#idObject

Returns the value of attribute id.



3
4
5
# File 'lib/team.rb', line 3

def id
  @id
end

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/team.rb', line 3

def name
  @name
end

Class Method Details

.Get(id) ⇒ Object



10
11
12
13
14
15
16
17
# File 'lib/team.rb', line 10

def Get(id)
    res = Spark::rest('GET',"/teams/#{id}")
    if res.ok
        team = Spark::Team.new(JSON.parse(res.body))
        return team
    end
    return nil
end