Module: Virgola::AttributeMethods

Extended by:
ActiveSupport::Concern
Includes:
ActiveModel::AttributeMethods
Included in:
Virgola
Defined in:
lib/virgola/attribute_methods.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#attribute(name) ⇒ Object



28
29
30
# File 'lib/virgola/attribute_methods.rb', line 28

def attribute(name)
  instance_variable_get "@#{name}"
end

#attribute=(name, value) ⇒ Object



32
33
34
# File 'lib/virgola/attribute_methods.rb', line 32

def attribute=(name, value)
  instance_variable_set "@#{name}", value
end

#attribute?(name) ⇒ Boolean



36
37
38
# File 'lib/virgola/attribute_methods.rb', line 36

def attribute?(name)
  self.attribute(name).present?
end

#attributesObject



40
41
42
# File 'lib/virgola/attribute_methods.rb', line 40

def attributes
  self.class.attributes
end