Class: Recliner::ViewFunction

Inherits:
Object
  • Object
show all
Defined in:
lib/recliner/views/function.rb

Direct Known Subclasses

Map, Reduce

Defined Under Namespace

Classes: Map, Reduce

Instance Method Summary collapse

Constructor Details

#initialize(body) ⇒ ViewFunction

Returns a new instance of ViewFunction.



5
6
7
8
9
10
11
# File 'lib/recliner/views/function.rb', line 5

def initialize(body)
  if body =~ /^\s*function/
    @body = body
  else
    @body = "#{definition} { #{body} }"
  end
end

Instance Method Details

#==(other) ⇒ Object



17
18
19
# File 'lib/recliner/views/function.rb', line 17

def ==(other)
  to_s == other.to_s
end

#to_sObject



13
14
15
# File 'lib/recliner/views/function.rb', line 13

def to_s
  @body
end