Module: Oshpark::Model::ClassMethods

Defined in:
lib/oshpark/model.rb

Instance Method Summary collapse

Instance Method Details

#attrsObject



35
36
37
# File 'lib/oshpark/model.rb', line 35

def attrs
  []
end

#from_json(json) ⇒ Object



30
31
32
33
# File 'lib/oshpark/model.rb', line 30

def from_json json
  model = self.new json
  model
end

#object_nameObject



39
40
41
# File 'lib/oshpark/model.rb', line 39

def object_name
  self.name.split('::').last.downcase
end

#object_namesObject



43
44
45
# File 'lib/oshpark/model.rb', line 43

def object_names
  "#{object_name}s"
end