Class: Dgrid::API::Link
Instance Attribute Summary collapse
-
#auto_linked ⇒ Object
readonly
Returns the value of attribute auto_linked.
-
#descriptoion ⇒ Object
Returns the value of attribute descriptoion.
-
#left_guid ⇒ Object
Returns the value of attribute left_guid.
-
#left_type ⇒ Object
Returns the value of attribute left_type.
-
#right_guid ⇒ Object
Returns the value of attribute right_guid.
-
#right_type ⇒ Object
Returns the value of attribute right_type.
Attributes inherited from Entity
#description, #id, #workspaces
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(options) ⇒ Link
constructor
A new instance of Link.
- #to_hash ⇒ Object
Methods inherited from Entity
#add_entity, #add_workspace, #attach, #connection, #first_workspace, #in_workspace?, #link_to, #new_record?, singular, #type, type
Methods included from SetMembersFromHash
#change_string_keys_to_symbol_keys, #set_members_from_hash, #split_hash
Methods included from Dgrid::ArgumentValidation
Constructor Details
#initialize(options) ⇒ Link
Returns a new instance of Link.
15 16 17 18 19 20 |
# File 'lib/dgrid/api/link.rb', line 15 def initialize() parent_opts, my_opts = split_hash(,[:id, :description]) super(parent_opts) @auto_linked = false set_members_from_hash() end |
Instance Attribute Details
#auto_linked ⇒ Object (readonly)
Returns the value of attribute auto_linked.
6 7 8 |
# File 'lib/dgrid/api/link.rb', line 6 def auto_linked @auto_linked end |
#descriptoion ⇒ Object
Returns the value of attribute descriptoion.
5 6 7 |
# File 'lib/dgrid/api/link.rb', line 5 def descriptoion @descriptoion end |
#left_guid ⇒ Object
Returns the value of attribute left_guid.
5 6 7 |
# File 'lib/dgrid/api/link.rb', line 5 def left_guid @left_guid end |
#left_type ⇒ Object
Returns the value of attribute left_type.
5 6 7 |
# File 'lib/dgrid/api/link.rb', line 5 def left_type @left_type end |
#right_guid ⇒ Object
Returns the value of attribute right_guid.
5 6 7 |
# File 'lib/dgrid/api/link.rb', line 5 def right_guid @right_guid end |
#right_type ⇒ Object
Returns the value of attribute right_type.
5 6 7 |
# File 'lib/dgrid/api/link.rb', line 5 def right_type @right_type end |
Class Method Details
.db_fields ⇒ Object
22 23 24 |
# File 'lib/dgrid/api/link.rb', line 22 def self.db_fields %w(id description auto_linked left_type left_guid left_id right_type right_guid right_id) end |
.pluralized ⇒ Object
26 27 28 |
# File 'lib/dgrid/api/link.rb', line 26 def self.pluralized 'links' end |
Instance Method Details
#to_hash ⇒ Object
30 31 32 33 34 35 36 37 |
# File 'lib/dgrid/api/link.rb', line 30 def to_hash h = { :description => description, :left_type => left_type, :left_guid => left_guid, :right_type => right_type, :right_guid => right_guid } end |