Class: Harbor::XMLViewContext

Inherits:
ViewContext show all
Defined in:
lib/harbor/xml_view.rb

Instance Attribute Summary

Attributes inherited from ViewContext

#keys, #view

Instance Method Summary collapse

Methods inherited from ViewContext

#[], #[]=, #capture, #clear, #each, #initialize, #locale, #merge, #plugin, #replace, #to_hash

Methods included from ViewContext::Helpers::Cache

#cache

Methods included from ViewContext::Helpers::Url

#merge_query_string

Methods included from ViewContext::Helpers::Html

#split_into_columns, #split_into_groups

Methods included from ViewContext::Helpers::Text

#h, #q, #truncate, #truncate_on_words

Methods included from ViewContext::Helpers::Form

#form

Constructor Details

This class inherits a constructor from Harbor::ViewContext

Instance Method Details

#render(partial, variables = nil) ⇒ Object



7
8
9
10
11
12
13
14
15
# File 'lib/harbor/xml_view.rb', line 7

def render(partial, variables=nil)
  context = to_hash

  result = XMLView.new(partial, merge(variables)).to_s

  replace(context)

  result
end

#xmlObject



17
18
19
# File 'lib/harbor/xml_view.rb', line 17

def xml
  @view.xml
end