Class: Google::Books::IndustryIdentifier

Inherits:
Object
  • Object
show all
Defined in:
lib/bookle/google_books_industry_identifier.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(identifier) ⇒ IndustryIdentifier

Returns a new instance of IndustryIdentifier.



6
7
8
9
10
# File 'lib/bookle/google_books_industry_identifier.rb', line 6

def initialize(identifier)
  identifier   = {} unless identifier
  @type      = identifier["type"]
  @identifier = identifier["identifier"]
end

Instance Attribute Details

#identifierObject (readonly)

Returns the value of attribute identifier.



4
5
6
# File 'lib/bookle/google_books_industry_identifier.rb', line 4

def identifier
  @identifier
end

#typeObject (readonly)

Returns the value of attribute type.



4
5
6
# File 'lib/bookle/google_books_industry_identifier.rb', line 4

def type
  @type
end

Instance Method Details

#to_hashObject



12
13
14
# File 'lib/bookle/google_books_industry_identifier.rb', line 12

def to_hash
  {self.type.downcase => self.identifier}
end