Class: Membrane::Schemas::Class
- Defined in:
- lib/membrane/schemas/class.rb
Defined Under Namespace
Classes: ClassValidator
Instance Attribute Summary collapse
-
#klass ⇒ Object
readonly
Returns the value of attribute klass.
Instance Method Summary collapse
-
#initialize(klass) ⇒ Class
constructor
A new instance of Class.
-
#validate(object) ⇒ Object
Validates whether or not the supplied object is derived from klass.
Methods inherited from Base
Constructor Details
#initialize(klass) ⇒ Class
Returns a new instance of Class.
7 8 9 |
# File 'lib/membrane/schemas/class.rb', line 7 def initialize(klass) @klass = klass end |
Instance Attribute Details
#klass ⇒ Object (readonly)
Returns the value of attribute klass.
5 6 7 |
# File 'lib/membrane/schemas/class.rb', line 5 def klass @klass end |
Instance Method Details
#validate(object) ⇒ Object
Validates whether or not the supplied object is derived from klass
12 13 14 |
# File 'lib/membrane/schemas/class.rb', line 12 def validate(object) ClassValidator.new(@klass, object).validate end |