Class: Camdram::Role

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

Instance Attribute Summary collapse

Attributes inherited from Base

#id

Instance Method Summary collapse

Methods inherited from Base

#make_orphan

Constructor Details

#initialize(*args) ⇒ Camdram::Role

Instantiate a new Role object from a JSON hash

Parameters:

  • options (Hash)

    A single JSON hash with symbolized keys.


15
16
17
18
19
# File 'lib/camdram/role.rb', line 15

def initialize(*args)
  super(*args)
  @show = Show.new(@show, @client_instance) unless @show.nil?
  @person = Person.new(@person, @client_instance) unless @person.nil?
end

Instance Attribute Details

#orderObject

Returns the value of attribute order


9
10
11
# File 'lib/camdram/role.rb', line 9

def order
  @order
end

#personObject

Returns the value of attribute person


9
10
11
# File 'lib/camdram/role.rb', line 9

def person
  @person
end

#person_nameObject

Returns the value of attribute person_name


9
10
11
# File 'lib/camdram/role.rb', line 9

def person_name
  @person_name
end

#person_slugObject

Returns the value of attribute person_slug


9
10
11
# File 'lib/camdram/role.rb', line 9

def person_slug
  @person_slug
end

#roleObject

Returns the value of attribute role


9
10
11
# File 'lib/camdram/role.rb', line 9

def role
  @role
end

#showObject

Returns the value of attribute show


9
10
11
# File 'lib/camdram/role.rb', line 9

def show
  @show
end

#tagObject

Returns the value of attribute tag


9
10
11
# File 'lib/camdram/role.rb', line 9

def tag
  @tag
end

#typeObject

Returns the value of attribute type


9
10
11
# File 'lib/camdram/role.rb', line 9

def type
  @type
end

Instance Method Details

#infoHash

Return a hash of the roles's attributes

Returns:

  • (Hash)

    Hash with symbolized keys.


24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/camdram/role.rb', line 24

def info
  {
    person_name: person_name,
    person_slug: person_slug,
    id: id,
    type: type,
    role: role,
    order: order,
    tag: tag,
    show: show,
    person: person,
  }
end