Class: When::Parts::Resource::Element

Inherits:
Object
  • Object
show all
Defined in:
lib/when_exe/parts/resource.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(key, object = nil, marked = nil) ⇒ Element

Returns a new instance of Element.



29
30
31
32
33
34
35
# File 'lib/when_exe/parts/resource.rb', line 29

def initialize(key, object=nil, marked=nil)
  key = key.downcase.gsub(/-/,'_') if (key==key.upcase)
  @predicate, @namespace = key.split(/:/).reverse
  @object    = object
  @marked    = marked
  @attribute = {}
end

Instance Attribute Details

#attributeObject (readonly)

Returns the value of attribute attribute.



25
26
27
# File 'lib/when_exe/parts/resource.rb', line 25

def attribute
  @attribute
end

#markedObject (readonly)

Returns the value of attribute marked.



27
28
29
# File 'lib/when_exe/parts/resource.rb', line 27

def marked
  @marked
end

#namespaceObject

Returns the value of attribute namespace.



26
27
28
# File 'lib/when_exe/parts/resource.rb', line 26

def namespace
  @namespace
end

#objectObject (readonly)

Returns the value of attribute object.



24
25
26
# File 'lib/when_exe/parts/resource.rb', line 24

def object
  @object
end

#predicateObject (readonly)

Returns the value of attribute predicate.



23
24
25
# File 'lib/when_exe/parts/resource.rb', line 23

def predicate
  @predicate
end