Module: Sequencescape::Api::Resource::Json

Included in:
Sequencescape::Api::Resource
Defined in:
lib/sequencescape-api/resource/json.rb

Defined Under Namespace

Modules: ClassMethods

Class Method Summary (collapse)

Instance Method Summary (collapse)

Class Method Details

+ (Object) included(base)



2
3
4
5
6
# File 'lib/sequencescape-api/resource/json.rb', line 2

def self.included(base)
  base.class_eval do
    extend ClassMethods
  end
end

Instance Method Details

- (Object) as_json(options = nil)



18
19
20
21
# File 'lib/sequencescape-api/resource/json.rb', line 18

def as_json(options = nil)
  options = { :action => :create, :root => true }.merge(options || {})
  send(:as_json_for_#{options[:action]}", options)
end

- (Boolean) changed?



57
58
59
# File 'lib/sequencescape-api/resource/json.rb', line 57

def changed?
  super or associations.values.any?(&:changed?)
end