Class: Stele::Resource
- Inherits:
-
Object
- Object
- Stele::Resource
- Defined in:
- lib/stele/resource.rb
Instance Attribute Summary collapse
-
#attributes_definition ⇒ Object
readonly
Returns the value of attribute attributes_definition.
-
#operations ⇒ Object
readonly
Returns the value of attribute operations.
Class Method Summary collapse
Instance Method Summary collapse
- #attributes ⇒ Object
-
#initialize(attributes:, operations:) ⇒ Resource
constructor
A new instance of Resource.
Constructor Details
#initialize(attributes:, operations:) ⇒ Resource
Returns a new instance of Resource.
15 16 17 18 |
# File 'lib/stele/resource.rb', line 15 def initialize(attributes:, operations:) @attributes_definition = attributes @operations = operations end |
Instance Attribute Details
#attributes_definition ⇒ Object (readonly)
Returns the value of attribute attributes_definition.
13 14 15 |
# File 'lib/stele/resource.rb', line 13 def attributes_definition @attributes_definition end |
#operations ⇒ Object (readonly)
Returns the value of attribute operations.
13 14 15 |
# File 'lib/stele/resource.rb', line 13 def operations @operations end |
Class Method Details
.build(**args) ⇒ Object
4 5 6 7 8 9 10 11 |
# File 'lib/stele/resource.rb', line 4 def self.build(**args) i = new(**args) { 'attributes' => i.attributes, 'operations' => i.operations } end |
Instance Method Details
#attributes ⇒ Object
20 21 22 |
# File 'lib/stele/resource.rb', line 20 def attributes @attributes_definition.keys end |