Class: EventbriteSDK::Resource::SchemaDefinition
- Inherits:
-
Object
- Object
- EventbriteSDK::Resource::SchemaDefinition
- Defined in:
- lib/eventbrite_sdk/resource/schema_definition.rb
Instance Method Summary collapse
- #defined_keys ⇒ Object
- #dirty_comparable(field) ⇒ Object
-
#initialize(resource_name) ⇒ SchemaDefinition
constructor
A new instance of SchemaDefinition.
- #type(key) ⇒ Object
- #writeable?(key) ⇒ Boolean
Constructor Details
#initialize(resource_name) ⇒ SchemaDefinition
Returns a new instance of SchemaDefinition.
5 6 7 8 9 10 |
# File 'lib/eventbrite_sdk/resource/schema_definition.rb', line 5 def initialize(resource_name) @attrs = {} @read_only_keys = Set.new @comparable = FieldComparable.new @resource_name = resource_name end |
Instance Method Details
#defined_keys ⇒ Object
35 36 37 |
# File 'lib/eventbrite_sdk/resource/schema_definition.rb', line 35 def defined_keys attrs.keys end |
#dirty_comparable(field) ⇒ Object
39 40 41 |
# File 'lib/eventbrite_sdk/resource/schema_definition.rb', line 39 def dirty_comparable(field) comparable.value_for(attrs[field.key], field) end |
#type(key) ⇒ Object
31 32 33 |
# File 'lib/eventbrite_sdk/resource/schema_definition.rb', line 31 def type(key) attrs[key] end |
#writeable?(key) ⇒ Boolean
27 28 29 |
# File 'lib/eventbrite_sdk/resource/schema_definition.rb', line 27 def writeable?(key) whitelisted_attribute?(key) && !read_only?(key) end |