Class: PairKit::JsonSchema::Dsl::ScalarScaffold
- Defined in:
- lib/pair_kit/json_schema/dsl/scaffolds/scalar_scaffold.rb
Instance Method Summary collapse
- #<<(val) ⇒ Object
-
#initialize(val) ⇒ ScalarScaffold
constructor
A new instance of ScalarScaffold.
- #to_schema ⇒ Object
Methods inherited from Scaffold
Constructor Details
#initialize(val) ⇒ ScalarScaffold
Returns a new instance of ScalarScaffold.
5 6 7 |
# File 'lib/pair_kit/json_schema/dsl/scaffolds/scalar_scaffold.rb', line 5 def initialize(val) @value = val end |
Instance Method Details
#<<(val) ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/pair_kit/json_schema/dsl/scaffolds/scalar_scaffold.rb', line 9 def <<(val) if @value @value.is_a?(Array) ? @value << val : @value = [@value, val] else @value = val end end |
#to_schema ⇒ Object
17 18 19 |
# File 'lib/pair_kit/json_schema/dsl/scaffolds/scalar_scaffold.rb', line 17 def to_schema @value end |