Class: Schema
- Inherits:
-
Object
- Object
- Schema
- Defined in:
- lib/json-schema-reader.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
-
#uri ⇒ Object
Returns the value of attribute uri.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(data, uri) ⇒ Schema
constructor
A new instance of Schema.
- #path ⇒ Object
- #pretty_generate ⇒ Object
- #title ⇒ Object
Constructor Details
#initialize(data, uri) ⇒ Schema
Returns a new instance of Schema.
15 16 17 18 19 |
# File 'lib/json-schema-reader.rb', line 15 def initialize data, uri @data = JSON.parse data @uri = uri @data = @data end |
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
13 14 15 |
# File 'lib/json-schema-reader.rb', line 13 def data @data end |
#uri ⇒ Object
Returns the value of attribute uri.
13 14 15 |
# File 'lib/json-schema-reader.rb', line 13 def uri @uri end |
Class Method Details
Instance Method Details
#path ⇒ Object
25 26 27 |
# File 'lib/json-schema-reader.rb', line 25 def path @uri.dirname end |
#pretty_generate ⇒ Object
33 34 35 36 |
# File 'lib/json-schema-reader.rb', line 33 def pretty_generate puts @data.title print_line @data end |
#title ⇒ Object
29 30 31 |
# File 'lib/json-schema-reader.rb', line 29 def title @data.title end |