Class: Memento::Action::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/memento/action.rb

Direct Known Subclasses

Create, Destroy, Update

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(state) ⇒ Base

Returns a new instance of Base.



5
6
7
# File 'lib/memento/action.rb', line 5

def initialize(state)
  @state = state
end

Instance Attribute Details

#stateObject (readonly)

Returns the value of attribute state.



9
10
11
# File 'lib/memento/action.rb', line 9

def state
  @state
end

Class Method Details

.inherited(child) ⇒ Object



25
26
27
# File 'lib/memento/action.rb', line 25

def self.inherited(child)
  self.action_types << child.name.demodulize.underscore
end

Instance Method Details

#fetch?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/memento/action.rb', line 21

def fetch?
  true
end

#recordObject



13
14
15
# File 'lib/memento/action.rb', line 13

def record
  @state.record
end

#record_dataObject



17
18
19
# File 'lib/memento/action.rb', line 17

def record_data
  @state.record_data
end