Class: ActiveSP::GhostField
- Inherits:
-
Object
- Object
- ActiveSP::GhostField
show all
- Includes:
- Util
- Defined in:
- lib/activesp/ghost_field.rb
Overview
This class represents the field definitions for objects in SharePoint for which the fields cannot be changed and are thus not represented by an object in SharePoint. These include fields of sites, lists, users, grouos, roles, content types and fields. The interface of this class is not as complete as the interface if a Field, mainly because it does not make much sense to do so
Instance Attribute Summary collapse
Instance Method Summary
collapse
-
#attribute(name) ⇒ Integer, ...
Returns the value of the attribute of the given name, or nil if this object does not have an attribute by the given name.
-
#attributes ⇒ Hash{String => Integer, Float, String, Time, Boolean, Base}
Returns the attributes of this object as a Hash.
-
#has_attribute?(name) ⇒ Boolean
Returns whether or not this object has an attribute with the given name.
-
#initialize(name, type, mult, read_only, display_name = name) ⇒ GhostField
constructor
A new instance of GhostField.
-
#method_missing(m, *a, &b) ⇒ Object
-
#Type ⇒ Object
Constructor Details
#initialize(name, type, mult, read_only, display_name = name) ⇒ GhostField
Returns a new instance of GhostField.
41
42
43
|
# File 'lib/activesp/ghost_field.rb', line 41
def initialize(name, type, mult, read_only, display_name = name)
@Name, @DisplayName, @internal_type, @Mult, @ReadOnly = name, display_name, type, mult, read_only
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(m, *a, &b) ⇒ Object
71
72
73
74
75
76
77
78
|
# File 'lib/activesp/ghost_field.rb', line 71
def method_missing(m, *a, &b)
ms = m.to_s
if a.length == 0 && has_attribute?(ms)
attribute(ms)
else
super
end
end
|
Instance Attribute Details
#DisplayName ⇒ Object
38
39
40
|
# File 'lib/activesp/ghost_field.rb', line 38
def DisplayName
@DisplayName
end
|
#internal_type ⇒ Object
38
39
40
|
# File 'lib/activesp/ghost_field.rb', line 38
def internal_type
@internal_type
end
|
#Mult ⇒ Object
38
39
40
|
# File 'lib/activesp/ghost_field.rb', line 38
def Mult
@Mult
end
|
#Name ⇒ Object
38
39
40
|
# File 'lib/activesp/ghost_field.rb', line 38
def Name
@Name
end
|
#ReadOnly ⇒ Object
38
39
40
|
# File 'lib/activesp/ghost_field.rb', line 38
def ReadOnly
@ReadOnly
end
|
#Required ⇒ Object
38
39
40
|
# File 'lib/activesp/ghost_field.rb', line 38
def Required
@Required
end
|
Instance Method Details
#attribute(name) ⇒ Integer, ...
Returns the value of the attribute of the given name, or nil if this object does not have an attribute by the given name
59
60
61
|
# File 'lib/activesp/ghost_field.rb', line 59
def attribute(name)
current_attributes[name]
end
|
#attributes ⇒ Hash{String => Integer, Float, String, Time, Boolean, Base}
Returns the attributes of this object as a Hash
52
53
54
|
# File 'lib/activesp/ghost_field.rb', line 52
def attributes
original_attributes.dup
end
|
#has_attribute?(name) ⇒ Boolean
Returns whether or not this object has an attribute with the given name
66
67
68
|
# File 'lib/activesp/ghost_field.rb', line 66
def has_attribute?(name)
current_attributes.has_key?(name)
end
|
#Type ⇒ Object
46
47
48
|
# File 'lib/activesp/ghost_field.rb', line 46
def Type
translate_internal_type(self)
end
|