Class: Monokera::SDK::HashModel
- Inherits:
-
OpenStruct
- Object
- OpenStruct
- Monokera::SDK::HashModel
show all
- Includes:
- ActiveModelSerializer
- Defined in:
- lib/monokera/sdk/hash_model.rb
Class Method Summary
collapse
Instance Method Summary
collapse
#read_attribute_for_serialization
Class Method Details
.build(attrs) ⇒ Object
10
11
12
13
14
|
# File 'lib/monokera/sdk/hash_model.rb', line 10
def self.build(attrs)
raise 'Invalid keys `attributes`' if attrs.key?(:attributes) || attrs.key?('attributes')
JSON.parse(attrs.to_json, object_class: Monokera::SDK::HashModel)
end
|
.model_name ⇒ Object
24
25
26
|
# File 'lib/monokera/sdk/hash_model.rb', line 24
def self.model_name
self.name.to_s
end
|
Instance Method Details
#as_json(options = nil) ⇒ Object
20
21
22
|
# File 'lib/monokera/sdk/hash_model.rb', line 20
def as_json(options = nil)
@table.as_json(options).deep_symbolize_keys
end
|
#attributes ⇒ Object
16
17
18
|
# File 'lib/monokera/sdk/hash_model.rb', line 16
def attributes
self
end
|