class Pipl::API::Response::Age

Attributes

estimation[R]
from[R]
to[R]

Public Class Methods

new(age) click to toggle source
# File lib/pipl/api/response/age.rb, line 8
def initialize(age)
  @from = age["from_age"]
  @to = age["to_age"]
  @estimation = age["estimated_percent"].to_f / 100
end

Public Instance Methods

to_h()
Alias for: to_hash
to_hash() click to toggle source
# File lib/pipl/api/response/age.rb, line 18
def to_hash
  {
    range: to_range,
    estimation: estimation
  }
end
Also aliased as: to_h
to_range() click to toggle source
# File lib/pipl/api/response/age.rb, line 14
def to_range
  @from..@to
end