Class: Arrow::Applet::SigProxy

Inherits:
Object
  • Object
show all
Defined in:
lib/arrow/applet.rb

Overview

Proxy into the Applet’s signature for a given action.

Instance Method Summary collapse

Constructor Details

#initialize(action_name, klass) ⇒ SigProxy

Create a new proxy into the given klass‘s Signature for the specified action_name.



143
144
145
146
147
148
# File 'lib/arrow/applet.rb', line 143

def initialize( action_name, klass )
	@action_name = action_name.to_s.to_sym
	@signature = klass.signature
	@signature[:templates] ||= {}
	@signature[:validator_profiles] ||= {}
end

Instance Method Details

#templateObject

Get the template associated with the same name as the proxied action.



153
154
155
# File 'lib/arrow/applet.rb', line 153

def template
	@signature[:templates][@action_name]
end

#template=(tmpl) ⇒ Object

Set the template associated with the same name as the proxied action to tmpl.



160
161
162
# File 'lib/arrow/applet.rb', line 160

def template=( tmpl )
	@signature[:templates][@action_name] = tmpl
end

#validator_profileObject

Get the validator profile associated with the same name as the proxied action.



167
168
169
# File 'lib/arrow/applet.rb', line 167

def validator_profile
	@signature[:validator_profiles][@action_name]
end

#validator_profile=(hash) ⇒ Object

Set the validator profile associated with the same name as the proxied action to hash.



174
175
176
# File 'lib/arrow/applet.rb', line 174

def validator_profile=( hash )
	@signature[:validator_profiles][@action_name] = hash
end