Class: Dgrid::API::Lens
Instance Attribute Summary
Attributes inherited from NamedEntity
#name
Attributes inherited from Entity
#description, #id, #workspaces
Class Method Summary
collapse
Instance Method Summary
collapse
included
Methods inherited from Entity
#add_entity, #add_workspace, #attach, #connection, #first_workspace, #in_workspace?, #link_to, #new_record?, singular, #type, type
#change_string_keys_to_symbol_keys, #set_members_from_hash, #split_hash
Constructor Details
#initialize(options) ⇒ Lens
Returns a new instance of Lens.
8
9
10
|
# File 'lib/dgrid/api/lens.rb', line 8
def initialize(options)
super(options)
end
|
Class Method Details
.db_fields ⇒ Object
12
13
14
|
# File 'lib/dgrid/api/lens.rb', line 12
def self.db_fields
%w(id name)
end
|
.pluralized ⇒ Object
31
32
33
|
# File 'lib/dgrid/api/lens.rb', line 31
def self.pluralized
'lenses'
end
|
Instance Method Details
#add_item(item) ⇒ Object
22
23
24
|
# File 'lib/dgrid/api/lens.rb', line 22
def add_item(item)
add_entity(item)
end
|
#item_ids ⇒ Object
26
27
28
29
|
# File 'lib/dgrid/api/lens.rb', line 26
def item_ids
workspace = workspaces.values.first workspace.item_ids_in_lens(self)
end
|
#to_hash ⇒ Object
16
17
18
|
# File 'lib/dgrid/api/lens.rb', line 16
def to_hash
{ :name => name }
end
|