Module: Remarkable::Private
- Defined in:
- lib/remarkable/private_helpers.rb
Overview
:nodoc:
Instance Method Summary collapse
- #instance_variable_name ⇒ Object
-
#subject_class ⇒ Object
Returns the model class constant, as determined by the test class name.
Instance Method Details
#instance_variable_name ⇒ Object
14 15 16 |
# File 'lib/remarkable/private_helpers.rb', line 14 def instance_variable_name self.class.described_type.to_s.split(':').last.underscore end |
#subject_class ⇒ Object
Returns the model class constant, as determined by the test class name.
4 5 6 7 8 9 10 11 12 |
# File 'lib/remarkable/private_helpers.rb', line 4 def subject_class # TODO: fazer um mixin na classe de string para retornar o formato do variable_name variable_name = "@#{instance_variable_name}" if instance_variable_defined?(variable_name) instance_variable_get(variable_name) else self.class.described_type end end |