Module: Alula::Dcp::ResourceAttributes::InstanceMethods
- Defined in:
- lib/alula/dcp/resource_attributes.rb
Overview
Extensions to allow instances to get at their class config, either raw or reduced to a useable format for a specific task.
Instance Method Summary collapse
-
#date_fields ⇒ Object
Return the names of each field configured as a date type.
- #field_names ⇒ Object
- #fields ⇒ Object
- #get_type ⇒ Object
- #persisted? ⇒ Boolean
- #to_key ⇒ Object
-
#type(arg) ⇒ Object
Instance method extensions.
Instance Method Details
#date_fields ⇒ Object
Return the names of each field configured as a date type
207 208 209 |
# File 'lib/alula/dcp/resource_attributes.rb', line 207 def date_fields self.class.date_fields end |
#field_names ⇒ Object
195 196 197 |
# File 'lib/alula/dcp/resource_attributes.rb', line 195 def field_names self.class.field_names end |
#fields ⇒ Object
191 192 193 |
# File 'lib/alula/dcp/resource_attributes.rb', line 191 def fields self.class.get_fields end |
#get_type ⇒ Object
187 188 189 |
# File 'lib/alula/dcp/resource_attributes.rb', line 187 def get_type self.class.get_type end |
#persisted? ⇒ Boolean
199 200 201 202 203 |
# File 'lib/alula/dcp/resource_attributes.rb', line 199 def persisted? return false unless respond_to?(:index) !index.nil? end |
#to_key ⇒ Object
211 212 213 214 |
# File 'lib/alula/dcp/resource_attributes.rb', line 211 def to_key key = respond_to?(:index) && index key ? [key] : nil end |
#type(arg) ⇒ Object
Instance method extensions
183 184 185 |
# File 'lib/alula/dcp/resource_attributes.rb', line 183 def type(arg) self.class.type(arg) end |