Class: Unit::Types::RestrictedResource
- Inherits:
-
Object
- Object
- Unit::Types::RestrictedResource
- Defined in:
- lib/unit/types/restricted_resource.rb
Instance Attribute Summary collapse
-
#ids ⇒ Object
readonly
Returns the value of attribute ids.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(ids, type) ⇒ RestrictedResource
constructor
A new instance of RestrictedResource.
- #to_json_api ⇒ Object
Constructor Details
#initialize(ids, type) ⇒ RestrictedResource
Returns a new instance of RestrictedResource.
9 10 11 12 |
# File 'lib/unit/types/restricted_resource.rb', line 9 def initialize(ids, type) @ids = ids @type = type end |
Instance Attribute Details
#ids ⇒ Object (readonly)
Returns the value of attribute ids.
7 8 9 |
# File 'lib/unit/types/restricted_resource.rb', line 7 def ids @ids end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
7 8 9 |
# File 'lib/unit/types/restricted_resource.rb', line 7 def type @type end |
Instance Method Details
#to_json_api ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/unit/types/restricted_resource.rb', line 14 def to_json_api result = [] @ids.each do |id| result << { type: type, id: id } end result end |