Class: Satisfaction::Schema
- Inherits:
-
Object
- Object
- Satisfaction::Schema
- Defined in:
- lib/satisfaction/schema.rb
Instance Attribute Summary collapse
-
#schemas ⇒ Object
Returns the value of attribute schemas.
Instance Method Summary collapse
-
#initialize(path = File.join(File.dirname(__FILE__), "../schemas")) ⇒ Schema
constructor
A new instance of Schema.
Constructor Details
#initialize(path = File.join(File.dirname(__FILE__), "../schemas")) ⇒ Schema
Returns a new instance of Schema.
7 8 9 10 11 12 13 |
# File 'lib/satisfaction/schema.rb', line 7 def initialize(path = File.join(File.dirname(__FILE__), "../schemas")) @schemas = [] Dir.entries(path).select {|f| !File.directory? f}.each do |source| schema = File.read("#{path}/#{source}") @schemas << JSON.parse(schema) end end |
Instance Attribute Details
#schemas ⇒ Object
Returns the value of attribute schemas.
5 6 7 |
# File 'lib/satisfaction/schema.rb', line 5 def schemas @schemas end |