Sha256: 72bfe6003844cf3afdb1e60bbe376b55a16706ea6742fa79d6afdd71df666290

Contents?: true

Size: 780 Bytes

Versions: 9

Compression:

Stored size: 780 Bytes

Contents

module BentoSearch
  class Author
    include ::BentoSearch::Results::Serialization

    def initialize(args ={})
      args.each_pair do |key, value|
        send("#{key}=", value)
      end
    end
    
    # Can be first name or initial, whatever source provides
    serializable_attr_accessor :first
    # last name/surname/family name as provided by source
    serializable_attr_accessor :last
    # middle name or initial, as and if provided by source
    serializable_attr_accessor :middle
    
    # if source doens't provide seperate first/last, 
    # source may only be able to provide one big string, author_display
    serializable_attr_accessor :display
    
    def empty?
      first.blank? && last.blank? && middle.blank? && display.blank?
    end
    
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
bento_search-2.0.0.rc1 app/models/bento_search/author.rb
bento_search-1.7.0 app/models/bento_search/author.rb
bento_search-1.6.1 app/models/bento_search/author.rb
bento_search-1.7.0.beta.1 app/models/bento_search/author.rb
bento_search-1.6.0 app/models/bento_search/author.rb
bento_search-1.5.0 app/models/bento_search/author.rb
bento_search-1.4.4 app/models/bento_search/author.rb
bento_search-1.4.3 app/models/bento_search/author.rb
bento_search-1.4.2 app/models/bento_search/author.rb