Class: DMap::Validations::Accessor

Inherits:
Object
  • Object
show all
Defined in:
lib/dmap/validations/access.rb

Direct Known Subclasses

Access

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#propertyObject

Returns the value of attribute property.



4
5
6
# File 'lib/dmap/validations/access.rb', line 4

def property
  @property
end

Class Method Details

.is_valid?(command) ⇒ Boolean

Return true if it’s valid

Returns:

  • (Boolean)


14
15
16
# File 'lib/dmap/validations/access.rb', line 14

def self.is_valid?(command)
  (command == "protected" or command == "public" or command == "private")
end

.parent_nameObject

for aliases



9
10
11
# File 'lib/dmap/validations/access.rb', line 9

def self.parent_name
  "Accessor"
end

.propertyObject



6
# File 'lib/dmap/validations/access.rb', line 6

def self.property; true; end

.validate(command = nil) ⇒ Object

This is what’s returned to our template



19
20
21
22
# File 'lib/dmap/validations/access.rb', line 19

def self.validate(command=nil)
  command ||= "protected"
  ":" + command
end