Class: TreasureData::API::ToHashStruct
- Inherits:
-
Struct
- Object
- Struct
- TreasureData::API::ToHashStruct
show all
- Extended by:
- ClassModule
- Defined in:
- lib/td/client/api/to_hash_struct.rb
Defined Under Namespace
Modules: ClassModule
Instance Method Summary
collapse
from_hash, from_json, model, model_property, parse_json
Instance Method Details
#to_h ⇒ Object
38
39
40
41
42
43
44
|
# File 'lib/td/client/api/to_hash_struct.rb', line 38
def to_h
self.class.members.inject({}) { |r, e|
v = obj_to_h(self[e])
r[e.to_s] = v unless v.nil?
r
}
end
|
#to_json ⇒ Object
46
47
48
|
# File 'lib/td/client/api/to_hash_struct.rb', line 46
def to_json
to_h.to_json
end
|
#validate ⇒ Object
50
51
52
53
54
55
56
|
# File 'lib/td/client/api/to_hash_struct.rb', line 50
def validate
validate_self
values.each do |v|
v.validate if v.is_a?(ToHashStruct)
end
self
end
|
#validate_self ⇒ Object
58
59
60
|
# File 'lib/td/client/api/to_hash_struct.rb', line 58
def validate_self
end
|