Class: Adsedare::Capability
- Inherits:
-
Object
- Object
- Adsedare::Capability
- Defined in:
- lib/adsedare/capabilities.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #check?(bundle_info) ⇒ Boolean
-
#initialize(type) ⇒ Capability
constructor
A new instance of Capability.
- #to_bundle_capability(bundle_info, team_id) ⇒ Object
Constructor Details
#initialize(type) ⇒ Capability
Returns a new instance of Capability.
61 62 63 |
# File 'lib/adsedare/capabilities.rb', line 61 def initialize(type) @type = type end |
Instance Attribute Details
#type ⇒ Object (readonly)
Returns the value of attribute type.
59 60 61 |
# File 'lib/adsedare/capabilities.rb', line 59 def type @type end |
Instance Method Details
#check?(bundle_info) ⇒ Boolean
65 66 67 68 69 70 |
# File 'lib/adsedare/capabilities.rb', line 65 def check?(bundle_info) bundle_info["included"].any? { |cap| cap["type"] == "capabilities" && cap["id"] == @type } end |
#to_bundle_capability(bundle_info, team_id) ⇒ Object
72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
# File 'lib/adsedare/capabilities.rb', line 72 def to_bundle_capability(bundle_info, team_id) return { "type" => "bundleIdCapabilities", "attributes" => { "enabled" => true, "settings" => [], }, "relationships" => { "capability" => { "data" => { "type" => "capabilities", "id" => @type }, }, }, } end |