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

Constructor Details

#initialize(options = {}) ⇒ Camdram::Role

Instantiate a new Role object from a JSON hash

Parameters:

  • options (Hash) (defaults to: {})

    A single JSON hash with symbolized keys.



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

def initialize(options = {})
  super(options)
  @show = Show.new( @show ) unless @show.nil?
  @person = Person.new( @person ) unless @person.nil?
end

Instance Attribute Details

#orderObject

Returns the value of attribute order.



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

def order
  @order
end

#personObject

Returns the value of attribute person.



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

def person
  @person
end

#person_nameObject

Returns the value of attribute person_name.



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

def person_name
  @person_name
end

#person_slugObject

Returns the value of attribute person_slug.



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

def person_slug
  @person_slug
end

#roleObject

Returns the value of attribute role.



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

def role
  @role
end

#showObject

Returns the value of attribute show.



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

def show
  @show
end

#typeObject

Returns the value of attribute type.



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

def type
  @type
end

Instance Method Details

#infoHash

Return a hash of the roles's attributes

Returns:

  • (Hash)

    Hash with symbolized keys.



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

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