class Beaver::US
US
Model.
Attributes
Public Class Methods
from_hash(hash)
click to toggle source
Creates an instance of the object from a hash.
# File lib/beaver/models/us.rb, line 33 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. social_security_number = hash['social_security_number'] social_security_number_last_four = hash['social_security_number_last_four'] # Create object from extracted values. US.new(social_security_number, social_security_number_last_four) end
names()
click to toggle source
A mapping from model property names to API property names.
# File lib/beaver/models/us.rb, line 18 def self.names @_hash = {} if @_hash.nil? @_hash['social_security_number'] = 'social_security_number' @_hash['social_security_number_last_four'] = 'social_security_number_last_four' @_hash end
new(social_security_number = nil, social_security_number_last_four = nil)
click to toggle source
# File lib/beaver/models/us.rb, line 26 def initialize(social_security_number = nil, social_security_number_last_four = nil) @social_security_number = social_security_number @social_security_number_last_four = social_security_number_last_four end