Sha256: cf33b6e8c60145aa8471677235a7292e7227cf1590f6f84f08de5770ebd8c327

Contents?: true

Size: 917 Bytes

Versions: 53

Compression:

Stored size: 917 Bytes

Contents

class Ey::Core::Client
  class Real
    def enable_feature(params={})
      account_id = params["account"]
      feature_id = params["feature"]["id"]

      request(
        :method => :post,
        :path   => "accounts/#{account_id}/features/#{feature_id}"
      )
    end
  end # Real

  class Mock
    def enable_feature(params={})
      account_id  = params["account"]
      resource_id = params["feature"]["id"]

      account = self.data[:accounts][account_id]
      feature = self.data[:features][resource_id]

      account_url = url_for("/accounts/#{account_id}")
      feature["account"] = account_url

      response(
        :body   => {"feature" => {
                      "id" => feature[:id],
                      "name" => feature[:name],
                      "description" => feature[:description]}
                    },
        :status => 200
      )
    end
  end # Mock
end # Ey::Core::Client

Version data entries

53 entries across 53 versions & 3 rubygems

Version Path
ey-core-3.6.4 lib/ey-core/requests/enable_feature.rb
ey-core-3.6.3 lib/ey-core/requests/enable_feature.rb
ey-core-3.6.1 lib/ey-core/requests/enable_feature.rb
groove-ey-core-3.6.3 lib/ey-core/requests/enable_feature.rb
groove-ey-core-3.6.2 lib/ey-core/requests/enable_feature.rb
groove-ey-core-3.6.1 lib/ey-core/requests/enable_feature.rb
ey-core-3.5.0 lib/ey-core/requests/enable_feature.rb
ey-core-3.4.4 lib/ey-core/requests/enable_feature.rb
ey-core-3.4.2 lib/ey-core/requests/enable_feature.rb
ey-core-3.4.1 lib/ey-core/requests/enable_feature.rb
ey-core-3.4.0 lib/ey-core/requests/enable_feature.rb
ey-core-3.3.1 lib/ey-core/requests/enable_feature.rb
ey-core-3.3.0 lib/ey-core/requests/enable_feature.rb
ey-core-3.2.6 lib/ey-core/requests/enable_feature.rb
ey-core-3.2.5 lib/ey-core/requests/enable_feature.rb
ey-core-3.2.4 lib/ey-core/requests/enable_feature.rb
ey-core-3.2.3 lib/ey-core/requests/enable_feature.rb
ey-core-3.2.2 lib/ey-core/requests/enable_feature.rb
ey-core-3.2.1 lib/ey-core/requests/enable_feature.rb
ey-core-3.2.0 lib/ey-core/requests/enable_feature.rb