Class: Cyrax::Wrapper

Inherits:
Object
  • Object
show all
Includes:
HasActiveLogger::Mixin
Defined in:
lib/cyrax/wrapper.rb

Direct Known Subclasses

Decorator, Presenter, Serializer

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(resource = nil, options = {}) ⇒ Wrapper

Returns a new instance of Wrapper.



7
8
9
10
11
# File 'lib/cyrax/wrapper.rb', line 7

def initialize(resource = nil, options = {})
  @resource = resource
  @options = options
  @accessor = options[:as]
end

Instance Attribute Details

#accessorObject

Returns the value of attribute accessor.



5
6
7
# File 'lib/cyrax/wrapper.rb', line 5

def accessor
  @accessor
end

#optionsObject

Returns the value of attribute options.



4
5
6
# File 'lib/cyrax/wrapper.rb', line 4

def options
  @options
end

#resourceObject

Returns the value of attribute resource.



3
4
5
# File 'lib/cyrax/wrapper.rb', line 3

def resource
  @resource
end