Class: Schai::Array
- Inherits:
-
Object
- Object
- Schai::Array
- Defined in:
- lib/schai/hoge.rb
Instance Attribute Summary collapse
-
#items ⇒ Object
Returns the value of attribute items.
Attributes included from Metadata
Attributes included from Optional
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(params) ⇒ Array
constructor
A new instance of Array.
- #to_schema ⇒ Object
Constructor Details
Instance Attribute Details
#items ⇒ Object
Returns the value of attribute items.
103 104 105 |
# File 'lib/schai/hoge.rb', line 103 def items @items end |
Class Method Details
.parse(params) ⇒ Object
104 105 106 |
# File 'lib/schai/hoge.rb', line 104 def self.parse params self.new params end |
Instance Method Details
#to_schema ⇒ Object
115 116 117 118 119 120 121 122 123 |
# File 'lib/schai/hoge.rb', line 115 def to_schema schema = { type: :array, } schema[:description] = @description if @description schema[:items] = @items.to_schema schema[:example] = @example if @example schema end |