Class: Meta::JsonSchema::JsonObject
- Inherits:
-
Object
- Object
- Meta::JsonSchema::JsonObject
show all
- Defined in:
- lib/meta/json_schema/support/json_object.rb
Class Method Summary
collapse
Instance Method Summary
collapse
Constructor Details
#initialize(target) ⇒ JsonObject
Returns a new instance of JsonObject.
7
8
9
|
# File 'lib/meta/json_schema/support/json_object.rb', line 7
def initialize(target)
@target = target
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args) ⇒ Object
23
24
25
|
# File 'lib/meta/json_schema/support/json_object.rb', line 23
def method_missing(method, *args)
@target.__send__(method, *args)
end
|
Class Method Details
.wrap(target) ⇒ Object
27
28
29
30
31
32
33
34
|
# File 'lib/meta/json_schema/support/json_object.rb', line 27
def self.wrap(target)
case target
when JsonObject, Hash
target
else
new(target)
end
end
|
Instance Method Details
#[](key) ⇒ Object
19
20
21
|
# File 'lib/meta/json_schema/support/json_object.rb', line 19
def [](key)
@target.__send__(key)
end
|
#__target__ ⇒ Object
11
12
13
|
# File 'lib/meta/json_schema/support/json_object.rb', line 11
def __target__
@target
end
|
#key?(key) ⇒ Boolean
15
16
17
|
# File 'lib/meta/json_schema/support/json_object.rb', line 15
def key?(key)
@target.respond_to?(key)
end
|