Class: PnoteClient::Documents::Hml::EmbeddingBinaryItem

Inherits:
Object
  • Object
show all
Defined in:
lib/pnote_client/documents/hml/embedding_binary_item.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(bin_item_id, bin_item_tag, doc) ⇒ EmbeddingBinaryItem

Returns a new instance of EmbeddingBinaryItem.



7
8
9
10
11
12
13
14
15
# File 'lib/pnote_client/documents/hml/embedding_binary_item.rb', line 7

def initialize(bin_item_id, bin_item_tag, doc)
  bin_data_id = bin_item_tag['BinData']
  bin_data = doc.at_xpath("//BINDATA[@Id=#{bin_data_id}]")

  @id = bin_item_id
  @raw_data = bin_data.content
  @format = bin_item_tag['Format']
  @size = bin_data['Size'].to_i
end

Instance Attribute Details

#formatObject (readonly)

Returns the value of attribute format.



5
6
7
# File 'lib/pnote_client/documents/hml/embedding_binary_item.rb', line 5

def format
  @format
end

#idObject (readonly)

Returns the value of attribute id.



5
6
7
# File 'lib/pnote_client/documents/hml/embedding_binary_item.rb', line 5

def id
  @id
end

#raw_dataObject (readonly)

Returns the value of attribute raw_data.



5
6
7
# File 'lib/pnote_client/documents/hml/embedding_binary_item.rb', line 5

def raw_data
  @raw_data
end

#sizeObject (readonly)

Returns the value of attribute size.



5
6
7
# File 'lib/pnote_client/documents/hml/embedding_binary_item.rb', line 5

def size
  @size
end