Class: Resourcerer::Strategy
- Inherits:
-
Object
- Object
- Resourcerer::Strategy
- Defined in:
- lib/resourcerer/strategy.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#config_proc ⇒ Object
readonly
Returns the value of attribute config_proc.
-
#controller ⇒ Object
readonly
Returns the value of attribute controller.
-
#inflector ⇒ Object
writeonly
Sets the attribute inflector.
-
#model ⇒ Object
writeonly
Sets the attribute model.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(controller, name, options = {}, config_proc = nil) ⇒ Strategy
constructor
A new instance of Strategy.
- #resource ⇒ Object
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, ={}, config_proc=nil) @controller, @name, @options, @config_proc = controller, name.to_s, , config_proc end |
Instance Attribute Details
#config_proc ⇒ Object (readonly)
Returns the value of attribute config_proc.
6 7 8 |
# File 'lib/resourcerer/strategy.rb', line 6 def config_proc @config_proc end |
#controller ⇒ Object (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
7 8 9 |
# File 'lib/resourcerer/strategy.rb', line 7 def inflector=(value) @inflector = value end |
#model=(value) ⇒ Object
Sets the attribute model
7 8 9 |
# File 'lib/resourcerer/strategy.rb', line 7 def model=(value) @model = value end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
6 7 8 |
# File 'lib/resourcerer/strategy.rb', line 6 def name @name end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
6 7 8 |
# File 'lib/resourcerer/strategy.rb', line 6 def @options end |
Instance Method Details
#resource ⇒ Object
13 14 15 |
# File 'lib/resourcerer/strategy.rb', line 13 def resource raise 'Implement in subclass' end |