Module: Friendly::Document::Attributes::ClassMethods
- Defined in:
- lib/friendly/document/attributes.rb
Instance Method Summary collapse
- #attribute(name, type = nil, options = {}) ⇒ Object
- #attributes ⇒ Object
- #new_without_change_tracking(attributes) ⇒ Object
Instance Method Details
#attribute(name, type = nil, options = {}) ⇒ Object
10 11 12 |
# File 'lib/friendly/document/attributes.rb', line 10 def attribute(name, type = nil, = {}) attributes[name] = Attribute.new(self, name, type, ) end |
#attributes ⇒ Object
14 15 16 |
# File 'lib/friendly/document/attributes.rb', line 14 def attributes @attributes ||= {} end |
#new_without_change_tracking(attributes) ⇒ Object
18 19 20 21 22 |
# File 'lib/friendly/document/attributes.rb', line 18 def new_without_change_tracking(attributes) doc = new(attributes) doc.reset_changes doc end |