Class: Springcm::AppliedAttributeField
- Defined in:
- lib/springcm-sdk/applied_attribute_field.rb
Instance Attribute Summary collapse
-
#group ⇒ Object
readonly
Returns the value of attribute group.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#set ⇒ Object
readonly
Returns the value of attribute set.
-
#subject ⇒ Object
readonly
Returns the value of attribute subject.
Instance Method Summary collapse
- #[](*args) ⇒ Object
- #[]=(key, val) ⇒ Object
-
#initialize(data, field_name, subject, group, set, client) ⇒ AppliedAttributeField
constructor
A new instance of AppliedAttributeField.
- #value ⇒ Object
- #value=(val) ⇒ Object
Methods inherited from Object
Constructor Details
#initialize(data, field_name, subject, group, set, client) ⇒ AppliedAttributeField
Returns a new instance of AppliedAttributeField.
10 11 12 13 14 15 16 |
# File 'lib/springcm-sdk/applied_attribute_field.rb', line 10 def initialize(data, field_name, subject, group, set, client) @subject = subject @group = group @set = set @name = field_name super(data, client) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Springcm::Object
Instance Attribute Details
#group ⇒ Object (readonly)
Returns the value of attribute group.
6 7 8 |
# File 'lib/springcm-sdk/applied_attribute_field.rb', line 6 def group @group end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
8 9 10 |
# File 'lib/springcm-sdk/applied_attribute_field.rb', line 8 def name @name end |
#set ⇒ Object (readonly)
Returns the value of attribute set.
7 8 9 |
# File 'lib/springcm-sdk/applied_attribute_field.rb', line 7 def set @set end |
#subject ⇒ Object (readonly)
Returns the value of attribute subject.
5 6 7 |
# File 'lib/springcm-sdk/applied_attribute_field.rb', line 5 def subject @subject end |
Instance Method Details
#[](*args) ⇒ Object
34 35 36 37 38 39 40 |
# File 'lib/springcm-sdk/applied_attribute_field.rb', line 34 def [](*args) if repeating_attribute == true Helpers.deserialize_value(@data["AttributeType"], @data["Value"].send(:[], *args)) else raise NonRepeatableAttributeFieldUsageError.new(group.name, name) end end |
#[]=(key, val) ⇒ Object
42 43 44 45 46 47 48 |
# File 'lib/springcm-sdk/applied_attribute_field.rb', line 42 def []=(key, val) if repeating_attribute == true @data["Value"].send(:[]=, key, val) else raise NonRepeatableAttributeFieldUsageError.new(group.name, name) end end |
#value ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/springcm-sdk/applied_attribute_field.rb', line 18 def value if repeating_attribute == true raise RepeatableAttributeFieldUsageError.new(group.name, name) else Helpers.deserialize_field(raw) end end |
#value=(val) ⇒ Object
26 27 28 29 30 31 32 |
# File 'lib/springcm-sdk/applied_attribute_field.rb', line 26 def value=(val) if repeating_attribute == true raise RepeatableAttributeFieldUsageError.new(group.name, name) else @data["Value"] = Helpers.serialize_value(@data["AttributeType"], val) end end |