Class: Kickplan::Resources::Features

Inherits:
Kickplan::Resource show all
Defined in:
lib/kickplan/resources/features.rb

Instance Attribute Summary

Attributes inherited from Kickplan::Resource

#client

Instance Method Summary collapse

Methods inherited from Kickplan::Resource

#initialize

Constructor Details

This class inherits a constructor from Kickplan::Resource

Instance Method Details

#configure(key, options = {}) ⇒ Object



6
7
8
9
10
# File 'lib/kickplan/resources/features.rb', line 6

def configure(key, options = {})
  params = Requests::ConfigureFeature.new(options.merge(key: key))

  adapter.configure_feature(params)
end

#resolve(key = nil, options = {}) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/kickplan/resources/features.rb', line 12

def resolve(key = nil, options = {})
  if key.nil? || key.is_a?(Hash)
    key, options = nil, key
  end

  params = Requests::ResolveFeature.new(options)

  response =
    if key.nil?
      adapter.resolve_features(params)
    else
      adapter.resolve_feature(key, params)
    end

  Responses::Resolution.wrap(response)
end