Class: TimestampAPI::Model

Inherits:
Object
  • Object
show all
Includes:
Hooks, ModelAttributes, ModelDefaultAPIMethods, ModelRelations, Utils
Defined in:
lib/timestamp_api/model.rb

Direct Known Subclasses

Client, Event, Project, Task, TimeEntry, User

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from ModelDefaultAPIMethods

included

Methods included from ModelRelations

included

Methods included from ModelAttributes

included

Methods included from Utils

#camelize, #camelize_keys

Constructor Details

#initialize(json_data) ⇒ Model

Returns a new instance of Model.



18
19
20
21
22
# File 'lib/timestamp_api/model.rb', line 18

def initialize(json_data)
  @json_data = json_data
  validate_init_data!
  run_hook :after_initialize
end

Instance Attribute Details

#json_dataObject (readonly)

Returns the value of attribute json_data.



3
4
5
# File 'lib/timestamp_api/model.rb', line 3

def json_data
  @json_data
end

Class Method Details

.inherited(subclass) ⇒ Object



13
14
15
16
# File 'lib/timestamp_api/model.rb', line 13

def self.inherited(subclass)
  ModelRegistry.register(subclass)
  run_hook :after_inherited, subclass
end