Module: BrNfe::Helper::HaveRps

Instance Method Summary collapse

Instance Method Details

#rps {|rps| ... } ⇒ Object

Yields:



4
5
6
7
# File 'lib/br_nfe/helper/have_rps.rb', line 4

def rps
	yield rps if block_given?
	@rps.is_a?(BrNfe.rps_class) ? @rps : @rps = BrNfe.rps_class.new
end

#rps=(value) ⇒ Object



9
10
11
12
13
14
15
# File 'lib/br_nfe/helper/have_rps.rb', line 9

def rps=(value)
	if value.is_a?(BrNfe.rps_class) || value.nil? 
		@rps = value
	elsif value.is_a?(Hash)
		rps.assign_attributes(value)
	end
end