Class: MiniTransformer::Book

Inherits:
Object
  • Object
show all
Defined in:
lib/mini_transformer/book.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#idObject

Returns the value of attribute id.



3
4
5
# File 'lib/mini_transformer/book.rb', line 3

def id
  @id
end

#introductionObject

Returns the value of attribute introduction.



3
4
5
# File 'lib/mini_transformer/book.rb', line 3

def introduction
  @introduction
end

#key_listObject

Returns the value of attribute key_list.



3
4
5
# File 'lib/mini_transformer/book.rb', line 3

def key_list
  @key_list
end

#titleObject

Returns the value of attribute title.



3
4
5
# File 'lib/mini_transformer/book.rb', line 3

def title
  @title
end

#typeObject

Returns the value of attribute type.



3
4
5
# File 'lib/mini_transformer/book.rb', line 3

def type
  @type
end

#uidObject

Returns the value of attribute uid.



3
4
5
# File 'lib/mini_transformer/book.rb', line 3

def uid
  @uid
end

Instance Method Details

#to_json(*a) ⇒ Object



5
6
7
8
9
10
11
12
13
14
# File 'lib/mini_transformer/book.rb', line 5

def to_json(*a)
  {
    'uid'   => self.uid,
    'type'  => self.type,
    'title' => self.title,
    'id'    => self.id,
    'introduction' => self.introduction,
    "key-list" => self.key_list.to_json
  }.to_json(*a)
end