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