Class: Importfilter

Inherits:
Object
  • Object
show all
Defined in:
lib/refworks/importfilter/importfilter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(rawfilter) ⇒ Importfilter

Returns a new instance of Importfilter.



4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/refworks/importfilter/importfilter.rb', line 4

def initialize(rawfilter)
  @name = rawfilter["Name"]
  @id = rawfilter["id"]
  @owner = rawfilter["owner"]
  @databases = Array.new

  # Promote all returned database values to arrays in the object, even if one database returned, for consistency
  if rawfilter["Database"].class == Array
    @databases = rawfilter["Database"]
  else
    @databases << rawfilter["Database"]
  end
end

Instance Attribute Details

#databasesObject (readonly)

Returns the value of attribute databases.



2
3
4
# File 'lib/refworks/importfilter/importfilter.rb', line 2

def databases
  @databases
end

#idObject (readonly)

Returns the value of attribute id.



2
3
4
# File 'lib/refworks/importfilter/importfilter.rb', line 2

def id
  @id
end

#nameObject (readonly)

Returns the value of attribute name.



2
3
4
# File 'lib/refworks/importfilter/importfilter.rb', line 2

def name
  @name
end

#ownerObject (readonly)

Returns the value of attribute owner.



2
3
4
# File 'lib/refworks/importfilter/importfilter.rb', line 2

def owner
  @owner
end