Class: Troles::Common::Marshaller::Generic
- Defined in:
- lib/troles/common/marshaller/generic.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#role_subject ⇒ Object
readonly
Returns the value of attribute role_subject.
-
#valid_roles ⇒ Object
readonly
Returns the value of attribute valid_roles.
Instance Method Summary collapse
-
#initialize(role_subject) ⇒ Generic
constructor
A new instance of Generic.
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_subject ⇒ Object (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_roles ⇒ Object (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 |