Class: Serrano::ContentNegotiation

Inherits:
Object
  • Object
show all
Defined in:
lib/serrano/cn.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ids, format = "bibtex", style = "apa", locale = "en-US") ⇒ ContentNegotiation

Returns a new instance of ContentNegotiation.



17
18
19
20
21
22
# File 'lib/serrano/cn.rb', line 17

def initialize(ids, format = "bibtex", style = "apa", locale = "en-US")
  self.ids = ids
  self.format = format
  self.style = style
  self.locale = locale
end

Instance Attribute Details

#formatObject

Returns the value of attribute format.



13
14
15
# File 'lib/serrano/cn.rb', line 13

def format
  @format
end

#idsObject

Returns the value of attribute ids.



12
13
14
# File 'lib/serrano/cn.rb', line 12

def ids
  @ids
end

#localeObject

Returns the value of attribute locale.



15
16
17
# File 'lib/serrano/cn.rb', line 15

def locale
  @locale
end

#styleObject

Returns the value of attribute style.



14
15
16
# File 'lib/serrano/cn.rb', line 14

def style
  @style
end

Instance Method Details

#cnObject



24
25
26
# File 'lib/serrano/cn.rb', line 24

def cn
  CNRequest.new(ids, format, style, locale).perform
end