Class: Camdram::Person

Inherits:
Base
  • Object
show all
Includes:
API
Defined in:
lib/camdram/person.rb

Instance Attribute Summary collapse

Attributes included from API

#http

Attributes inherited from Base

#id

Class Method Summary collapse

Instance Method Summary collapse

Methods included from API

#initialize, #update!

Methods inherited from Base

#initialize

Instance Attribute Details

#nameObject

Returns the value of attribute name.



7
8
9
# File 'lib/camdram/person.rb', line 7

def name
  @name
end

#slugObject

Returns the value of attribute slug.



7
8
9
# File 'lib/camdram/person.rb', line 7

def slug
  @slug
end

Class Method Details

.urlString

Returns the URL stub assocaited with all people

Returns:

  • (String)

    The URL stub.



30
31
32
# File 'lib/camdram/person.rb', line 30

def self.url
  '/people'
end

Instance Method Details

#infoHash

Return a hash of the person's attributes

Returns:

  • (Hash)

    Hash with symbolized keys.



12
13
14
15
16
17
18
# File 'lib/camdram/person.rb', line 12

def info
  {
    id: id,
    name: name,
    slug: slug,
  }
end

#url_slugString

Returns the URL+slug of the person

Returns:

  • (String)

    The full URL and slug.



23
24
25
# File 'lib/camdram/person.rb', line 23

def url_slug
  "#{self.class.url}/#{slug}.json"
end