Class: Pipl::API::Response::Gender

Inherits:
Object
  • Object
show all
Defined in:
lib/pipl/api/response/gender.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(gender) ⇒ Gender

Returns a new instance of Gender.



8
9
10
11
# File 'lib/pipl/api/response/gender.rb', line 8

def initialize(gender)
  @code = gender.first
  @estimation = gender.last
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



5
6
7
# File 'lib/pipl/api/response/gender.rb', line 5

def code
  @code
end

#estimationObject (readonly)

Returns the value of attribute estimation.



6
7
8
# File 'lib/pipl/api/response/gender.rb', line 6

def estimation
  @estimation
end

Instance Method Details

#to_hashObject Also known as: to_h



13
14
15
16
17
18
# File 'lib/pipl/api/response/gender.rb', line 13

def to_hash
  {
    code: code,
    estimation: estimation
  }
end