Module: BrNfe::Service::Association::HaveRps

Defined in:
lib/br_nfe/service/association/have_rps.rb

Instance Method Summary collapse

Instance Method Details

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

Yields:



5
6
7
8
# File 'lib/br_nfe/service/association/have_rps.rb', line 5

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

#rps=(value) ⇒ Object



10
11
12
13
14
15
16
# File 'lib/br_nfe/service/association/have_rps.rb', line 10

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