Class: Esaj::Metadata

Inherits:
Object
  • Object
show all
Defined in:
lib/esaj/metadata.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(url) ⇒ Metadata

Returns a new instance of Metadata.



7
8
9
# File 'lib/esaj/metadata.rb', line 7

def initialize(url)
  @url = url
end

Instance Attribute Details

#urlObject (readonly)

Returns the value of attribute url.



5
6
7
# File 'lib/esaj/metadata.rb', line 5

def url
  @url
end

Instance Method Details

#error?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/esaj/metadata.rb', line 15

def error?
  !error_message.empty?
end

#error_messageObject



19
20
21
# File 'lib/esaj/metadata.rb', line 19

def error_message
  formatted_error_message
end

#total_pagesObject



11
12
13
# File 'lib/esaj/metadata.rb', line 11

def total_pages
  (total_records.to_f/records_per_page).round
end