Class: Troles::Common::Marshaller::Generic

Inherits:
Object
  • Object
show all
Defined in:
lib/troles/common/marshaller/generic.rb

Direct Known Subclasses

Bitmask

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(role_subject) ⇒ Generic

Returns a new instance of Generic.



6
7
8
9
10
# File 'lib/troles/common/marshaller/generic.rb', line 6

def initialize role_subject
  raise "The roles subject is not valid: #{role_subject}" if !role_subject || !role_subject.respond_to?(:has_role?)
  @role_subject = role_subject
  @valid_roles = role_subject.class.valid_roles
end

Instance Attribute Details

#role_subjectObject (readonly)

Returns the value of attribute role_subject.



4
5
6
# File 'lib/troles/common/marshaller/generic.rb', line 4

def role_subject
  @role_subject
end

#valid_rolesObject (readonly)

Returns the value of attribute valid_roles.



4
5
6
# File 'lib/troles/common/marshaller/generic.rb', line 4

def valid_roles
  @valid_roles
end