Class: Restspec::Schema::Schema
- Inherits:
-
Object
- Object
- Restspec::Schema::Schema
- Defined in:
- lib/restspec/schema/schema.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #extend_with(without: []) ⇒ Object
-
#initialize(name) ⇒ Schema
constructor
A new instance of Schema.
Constructor Details
#initialize(name) ⇒ Schema
Returns a new instance of Schema.
6 7 8 9 |
# File 'lib/restspec/schema/schema.rb', line 6 def initialize(name) self.name = name self.attributes = {} end |
Instance Attribute Details
#attributes ⇒ Object
Returns the value of attribute attributes.
4 5 6 |
# File 'lib/restspec/schema/schema.rb', line 4 def attributes @attributes end |
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/restspec/schema/schema.rb', line 4 def name @name end |
Instance Method Details
#extend_with(without: []) ⇒ Object
11 12 13 14 |
# File 'lib/restspec/schema/schema.rb', line 11 def extend_with(without: []) without.each { |attribute_name| attributes.delete(attribute_name.to_s) } self end |