Class: AttributeChanger::Performer

Inherits:
Object
  • Object
show all
Defined in:
lib/attribute_changer/performer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attribs) ⇒ Performer

Returns a new instance of Performer.



4
5
6
7
8
# File 'lib/attribute_changer/performer.rb', line 4

def initialize(attribs)
  @obj = attribs[:obj]
  @attrib = attribs[:attrib]
  @value = attribs[:value]
end

Instance Attribute Details

#attribObject (readonly)

Returns the value of attribute attrib.



2
3
4
# File 'lib/attribute_changer/performer.rb', line 2

def attrib
  @attrib
end

#attrib_changeObject (readonly)

Returns the value of attribute attrib_change.



2
3
4
# File 'lib/attribute_changer/performer.rb', line 2

def attrib_change
  @attrib_change
end

#errorObject (readonly)

Returns the value of attribute error.



2
3
4
# File 'lib/attribute_changer/performer.rb', line 2

def error
  @error
end

#objObject (readonly)

Returns the value of attribute obj.



2
3
4
# File 'lib/attribute_changer/performer.rb', line 2

def obj
  @obj
end

#resultObject (readonly)

Returns the value of attribute result.



2
3
4
# File 'lib/attribute_changer/performer.rb', line 2

def result
  @result
end

Instance Method Details

#saveObject



10
11
12
13
14
15
16
# File 'lib/attribute_changer/performer.rb', line 10

def save
  valid
  return false if result && !result.success
  create_attribute_change
  @result = AttributeChanger::Utils::Result.new true, nil
  true
end