Class: Almodovar::ResourcePresenter::Serializer

Inherits:
Object
  • Object
show all
Defined in:
lib/almodovar-server/resource_presenter/serializer.rb

Direct Known Subclasses

HtmlSerializer, JsonSerializer, XmlSerializer

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(resource, options = {}) ⇒ Serializer

Returns a new instance of Serializer.



7
8
9
10
# File 'lib/almodovar-server/resource_presenter/serializer.rb', line 7

def initialize(resource, options = {})
  @resource = resource
  @options  = options
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



5
6
7
# File 'lib/almodovar-server/resource_presenter/serializer.rb', line 5

def options
  @options
end

#resourceObject (readonly)

Returns the value of attribute resource.



5
6
7
# File 'lib/almodovar-server/resource_presenter/serializer.rb', line 5

def resource
  @resource
end

Instance Method Details



12
13
14
# File 'lib/almodovar-server/resource_presenter/serializer.rb', line 12

def options_for_link
  options.merge(:dont_expand => Array(options[:dont_expand]) << resource.url)
end