Module: KongSchema::Resource::Upstream

Extended by:
Upstream
Included in:
Upstream
Defined in:
lib/kong_schema/resource/upstream.rb

Overview

Instance Method Summary collapse

Instance Method Details

#allObject



21
22
23
# File 'lib/kong_schema/resource/upstream.rb', line 21

def all(*)
  Kong::Upstream.all
end

#changed?(record, attributes) ⇒ Boolean

Returns:

  • (Boolean)


33
34
35
# File 'lib/kong_schema/resource/upstream.rb', line 33

def changed?(record, attributes)
  Adapter.for(Kong::Upstream).changed?(record.attributes, attributes)
end

#creatable?Boolean

Returns:

  • (Boolean)


29
30
31
# File 'lib/kong_schema/resource/upstream.rb', line 29

def creatable?(*)
  true
end

#create(attributes) ⇒ Object



25
26
27
# File 'lib/kong_schema/resource/upstream.rb', line 25

def create(attributes)
  Adapter.for(Kong::Upstream).create(attributes)
end

#delete(record) ⇒ Object



41
42
43
# File 'lib/kong_schema/resource/upstream.rb', line 41

def delete(record)
  Adapter.for(Kong::Upstream).delete(record)
end

#identify(record) ⇒ Object



12
13
14
15
16
17
18
19
# File 'lib/kong_schema/resource/upstream.rb', line 12

def identify(record)
  case record
  when Kong::Upstream
    record.name
  when Hash
    record['name']
  end
end

#update(record, partial_attributes) ⇒ Object



37
38
39
# File 'lib/kong_schema/resource/upstream.rb', line 37

def update(record, partial_attributes)
  Adapter.for(Kong::Upstream).update(record, partial_attributes)
end