Class: Restspec::Schema::Schema

Inherits:
Object
  • Object
show all
Defined in:
lib/restspec/schema/schema.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#attributesObject

Returns the value of attribute attributes.



4
5
6
# File 'lib/restspec/schema/schema.rb', line 4

def attributes
  @attributes
end

#nameObject

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