Module: StrawberryAPI::Client::Features

Included in:
StrawberryAPI::Client
Defined in:
lib/strawberry_api/client/features.rb

Instance Method Summary collapse

Instance Method Details

#feature(id:) ⇒ StrawberryAPI::Feature

Fetches a feature

Parameters:

  • id (Integer)

    Id of the feature to retrieve

Returns:



22
23
24
25
# File 'lib/strawberry_api/client/features.rb', line 22

def feature(id:)
   data = get("/features/#{id}").parse['feature']
   data.nil? ? nil : Feature.new(data)
end

#featuresArray<StrawberryAPI::Feature>

Fetches all features

Returns:



10
11
12
13
14
# File 'lib/strawberry_api/client/features.rb', line 10

def features
  get("/features").parse['features']&.map do |feature|
    Feature.new(feature)
  end
end