Class: Resourcerer::Strategy

Inherits:
Object
  • Object
show all
Defined in:
lib/resourcerer/strategy.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(controller, name, options = {}, config_proc = nil) ⇒ Strategy

Returns a new instance of Strategy.



9
10
11
# File 'lib/resourcerer/strategy.rb', line 9

def initialize(controller, name, options={}, config_proc=nil)
  @controller, @name, @options, @config_proc = controller, name.to_s, options, config_proc
end

Instance Attribute Details

#config_procObject (readonly)

Returns the value of attribute config_proc.



6
7
8
# File 'lib/resourcerer/strategy.rb', line 6

def config_proc
  @config_proc
end

#controllerObject (readonly)

Returns the value of attribute controller.



6
7
8
# File 'lib/resourcerer/strategy.rb', line 6

def controller
  @controller
end

#inflector=(value) ⇒ Object

Sets the attribute inflector

Parameters:

  • value

    the value to set the attribute inflector to.



7
8
9
# File 'lib/resourcerer/strategy.rb', line 7

def inflector=(value)
  @inflector = value
end

#model=(value) ⇒ Object

Sets the attribute model

Parameters:

  • value

    the value to set the attribute model to.



7
8
9
# File 'lib/resourcerer/strategy.rb', line 7

def model=(value)
  @model = value
end

#nameObject (readonly)

Returns the value of attribute name.



6
7
8
# File 'lib/resourcerer/strategy.rb', line 6

def name
  @name
end

#optionsObject (readonly)

Returns the value of attribute options.



6
7
8
# File 'lib/resourcerer/strategy.rb', line 6

def options
  @options
end

Instance Method Details

#resourceObject



13
14
15
# File 'lib/resourcerer/strategy.rb', line 13

def resource
  raise 'Implement in subclass'
end