Sha256: 9e38071dc225ee2ab268aec6d3210cd5003e03af4631d4b18b78fcb574d3c796

Contents?: true

Size: 1.42 KB

Versions: 6

Compression:

Stored size: 1.42 KB

Contents

require "date"

class Biography < Hashie::Trash
  include Hashie::Extensions::IgnoreUndeclared

  @split_on_comma = ->(i) { i.kind_of?(Array) ? i : i.split(", ") }

  property :first_name
  property :middle_name
  property :last_name
  property :full_name_at_birth
  property :other_names # array
  property :age, transform_with: ->(i) { i.to_i }
  property :born_on, from: :date_of_birth, transform_with: ->(i) { Date.parse(i) }
  property :born_at, from: :birthplace
  property :height
  property :weight
  property :build
  property :eye_color
  property :hair_color
  property :distinctive_features # array
  property :star_sign
  property :sexuality
  property :religion
  property :ethnicity
  property :nationality
  property :high_school
  property :occupation
  property :occupation_category
  property :claim_to_fame # array
  property :talent_agency
  property :brand_endorsements # array
  property :measurements_inches
  property :dress_size
  property :shoe_size
  property :websites, from: :official_website #array
  property :father
  property :mother
  property :brothers # array
  property :sisters # array
  property :friends, transform_with: @split_on_comma
  property :pets # array
  property :favorite_movies, transform_with: @split_on_comma
  property :favorite_places
  property :favorite_foods,  transform_with: @split_on_comma
  property :favorite_colors, transform_with: @split_on_comma
  property :favorite_accessories
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
whos_dated_who-0.2.2 lib/whos_dated_who/biography.rb
whos_dated_who-0.2.1 lib/whos_dated_who/biography.rb
whos_dated_who-0.2.0 lib/whos_dated_who/biography.rb
whos_dated_who-0.1.1 lib/whos_dated_who/biography.rb
whos_dated_who-0.1.0 lib/whos_dated_who/biography.rb
whos_dated_who-0.0.1 lib/whos_dated_who/biography.rb