Module: Shameless::Model::InstanceMethods

Defined in:
lib/shameless/model.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#uuidObject (readonly)

Returns the value of attribute uuid.



121
122
123
# File 'lib/shameless/model.rb', line 121

def uuid
  @uuid
end

Instance Method Details

#[](field) ⇒ Object



128
129
130
# File 'lib/shameless/model.rb', line 128

def [](field)
  base[field]
end

#[]=(field, value) ⇒ Object



132
133
134
# File 'lib/shameless/model.rb', line 132

def []=(field, value)
  base[field] = value
end

#as_jsonObject



164
165
166
# File 'lib/shameless/model.rb', line 164

def as_json(*)
  base.as_json
end

#cellsObject



172
173
174
# File 'lib/shameless/model.rb', line 172

def cells
  @cells.values
end

#created_atObject



148
149
150
# File 'lib/shameless/model.rb', line 148

def created_at
  base.created_at
end

#fetch(key, default) ⇒ Object



156
157
158
# File 'lib/shameless/model.rb', line 156

def fetch(key, default)
  base.fetch(key, default)
end

#fetch_cell(cell_name, ref_key = nil) ⇒ Object



180
181
182
# File 'lib/shameless/model.rb', line 180

def fetch_cell(cell_name, ref_key = nil)
 self.class.fetch_cell(shardable_value, uuid, cell_name, ref_key)
end

#initialize(uuid, base_body = nil) ⇒ Object



123
124
125
126
# File 'lib/shameless/model.rb', line 123

def initialize(uuid, base_body = nil)
  @uuid = uuid
  @cells = self.class.initialize_cells(self, base_body)
end

#present?Boolean

Returns:

  • (Boolean)


160
161
162
# File 'lib/shameless/model.rb', line 160

def present?
  base.present?
end

#prevent_readonly_attribute_mutation!(key) ⇒ Object



184
185
186
# File 'lib/shameless/model.rb', line 184

def prevent_readonly_attribute_mutation!(key)
  self.class.prevent_readonly_attribute_mutation!(key)
end

#previousObject



152
153
154
# File 'lib/shameless/model.rb', line 152

def previous
  base.previous
end

#put_cell(cell_values) ⇒ Object



176
177
178
# File 'lib/shameless/model.rb', line 176

def put_cell(cell_values)
  self.class.put_cell(shardable_value, cell_values)
end

#ref_keyObject



144
145
146
# File 'lib/shameless/model.rb', line 144

def ref_key
  base.ref_key
end

#reloadObject



168
169
170
# File 'lib/shameless/model.rb', line 168

def reload
  cells.each(&:reload)
end

#saveObject



140
141
142
# File 'lib/shameless/model.rb', line 140

def save
  base.save
end

#update(values) ⇒ Object



136
137
138
# File 'lib/shameless/model.rb', line 136

def update(values)
  base.update(values)
end