Class: Klipbook::Clipping

Inherits:
Struct
  • Object
show all
Defined in:
lib/klipbook/sources/clipping.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Methods inherited from Struct

#to_json, #to_map

Instance Attribute Details

#annotation_idObject

Returns the value of attribute annotation_id

Returns:

  • (Object)

    the current value of annotation_id



2
3
4
# File 'lib/klipbook/sources/clipping.rb', line 2

def annotation_id
  @annotation_id
end

#locationObject

Returns the value of attribute location

Returns:

  • (Object)

    the current value of location



2
3
4
# File 'lib/klipbook/sources/clipping.rb', line 2

def location
  @location
end

#pageObject

Returns the value of attribute page

Returns:

  • (Object)

    the current value of page



2
3
4
# File 'lib/klipbook/sources/clipping.rb', line 2

def page
  @page
end

#textObject

Returns the value of attribute text

Returns:

  • (Object)

    the current value of text



2
3
4
# File 'lib/klipbook/sources/clipping.rb', line 2

def text
  @text
end

#typeObject

Returns the value of attribute type

Returns:

  • (Object)

    the current value of type



2
3
4
# File 'lib/klipbook/sources/clipping.rb', line 2

def type
  @type
end

Class Method Details

.from_hash(hash) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'lib/klipbook/sources/clipping.rb', line 3

def self.from_hash(hash)
  self.new.tap do |b|
    b.annotation_id = hash['annotation_id']
    b.text = hash['text']
    b.location = hash['location']
    b.type = hash['type']
    b.page = hash['page']
  end
end