Module: StrawberryAPI::Client::Features
- Included in:
- StrawberryAPI::Client
- Defined in:
- lib/strawberry_api/client/features.rb
Instance Method Summary collapse
-
#feature(id:) ⇒ StrawberryAPI::Feature
Fetches a feature.
-
#features ⇒ Array<StrawberryAPI::Feature>
Fetches all features.
Instance Method Details
#feature(id:) ⇒ StrawberryAPI::Feature
Fetches a feature
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 |
#features ⇒ Array<StrawberryAPI::Feature>
Fetches all features
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 |