Class: Philosophal::Properties::Schema
- Inherits:
-
Object
- Object
- Philosophal::Properties::Schema
- Includes:
- Enumerable
- Defined in:
- lib/philosophal/properties/schema.rb
Instance Attribute Summary collapse
-
#properties_index ⇒ Object
readonly
Returns the value of attribute properties_index.
Instance Method Summary collapse
- #<<(value) ⇒ Object
- #[](key) ⇒ Object
- #immutables ⇒ Object
-
#initialize(properties_index: {}) ⇒ Schema
constructor
A new instance of Schema.
- #keys ⇒ Object
- #mutables ⇒ Object
Constructor Details
#initialize(properties_index: {}) ⇒ Schema
Returns a new instance of Schema.
8 9 10 11 |
# File 'lib/philosophal/properties/schema.rb', line 8 def initialize(properties_index: {}) @properties_index = properties_index @mutex = Mutex.new end |
Instance Attribute Details
#properties_index ⇒ Object (readonly)
Returns the value of attribute properties_index.
13 14 15 |
# File 'lib/philosophal/properties/schema.rb', line 13 def properties_index @properties_index end |
Instance Method Details
#<<(value) ⇒ Object
23 24 25 26 27 28 29 |
# File 'lib/philosophal/properties/schema.rb', line 23 def <<(value) @mutex.synchronize do @properties_index[value.name] = value end self end |
#[](key) ⇒ Object
15 16 17 |
# File 'lib/philosophal/properties/schema.rb', line 15 def [](key) @properties_index[key] end |
#immutables ⇒ Object
31 32 33 |
# File 'lib/philosophal/properties/schema.rb', line 31 def immutables @properties_index.select { |_, v| v.immutable } end |
#keys ⇒ Object
19 20 21 |
# File 'lib/philosophal/properties/schema.rb', line 19 def keys @properties_index.keys end |
#mutables ⇒ Object
35 36 37 |
# File 'lib/philosophal/properties/schema.rb', line 35 def mutables @properties_index.reject { |_, v| v.immutable } end |