class Beaver::PersonRbit
PersonRbit
Model.
Attributes
date_of_birth[RW]
TODO: Write general description for this method @return [DateOfBirth]
name[RW]
TODO: Write general description for this method @return [Name]
role[RW]
TODO: Write general description for this method @return [RoleEnum]
Public Class Methods
from_hash(hash)
click to toggle source
Creates an instance of the object from a hash.
# File lib/beaver/models/person_rbit.rb, line 39 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. name = Name.from_hash(hash['name']) if hash['name'] date_of_birth = DateOfBirth.from_hash(hash['date_of_birth']) if hash['date_of_birth'] role = hash['role'] # Create object from extracted values. PersonRbit.new(name, date_of_birth, role) end
names()
click to toggle source
A mapping from model property names to API property names.
# File lib/beaver/models/person_rbit.rb, line 22 def self.names @_hash = {} if @_hash.nil? @_hash['date_of_birth'] = 'date_of_birth' @_hash['name'] = 'name' @_hash['role'] = 'role' @_hash end
new(name = nil, date_of_birth = nil, role = nil)
click to toggle source
# File lib/beaver/models/person_rbit.rb, line 30 def initialize(name = nil, date_of_birth = nil, role = nil) @date_of_birth = date_of_birth @name = name @role = role end