Module: Err::Acts::Textiled::InstanceMethods

Defined in:
lib/acts_as_textiled/base.rb

Instance Method Summary collapse

Instance Method Details

#reloadObject



65
66
67
68
# File 'lib/acts_as_textiled/base.rb', line 65

def reload
  textiled.clear
  super
end

#textiledObject



49
50
51
# File 'lib/acts_as_textiled/base.rb', line 49

def textiled
  textiled? ? (@textiled ||= {}) : @attributes.dup
end

#textiled=(bool) ⇒ Object



57
58
59
# File 'lib/acts_as_textiled/base.rb', line 57

def textiled=(bool)
  @is_textiled = !!bool
end

#textiled?Boolean

Returns:

  • (Boolean)


53
54
55
# File 'lib/acts_as_textiled/base.rb', line 53

def textiled?
  @is_textiled != false
end

#textilizeObject



61
62
63
# File 'lib/acts_as_textiled/base.rb', line 61

def textilize
  self.class.textiled_attributes.each { |attr| __send__(attr) }
end

#write_attribute(attr_name, value) ⇒ Object



70
71
72
73
# File 'lib/acts_as_textiled/base.rb', line 70

def write_attribute(attr_name, value)
  textiled[attr_name.to_s] = nil
  super
end