Class: Wombat::Property

Inherits:
Object
  • Object
show all
Defined in:
lib/wombat/property.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Property

Returns a new instance of Property.



5
6
7
8
9
10
11
# File 'lib/wombat/property.rb', line 5

def initialize(options)
  @name = options[:name]
  @selector = options[:selector]
  @format = options[:format]
  @namespaces = options[:namespaces]
  @callback = options[:callback]
end

Instance Attribute Details

#callbackObject

Returns the value of attribute callback.



3
4
5
# File 'lib/wombat/property.rb', line 3

def callback
  @callback
end

#formatObject

Returns the value of attribute format.



3
4
5
# File 'lib/wombat/property.rb', line 3

def format
  @format
end

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/wombat/property.rb', line 3

def name
  @name
end

#namespacesObject

Returns the value of attribute namespaces.



3
4
5
# File 'lib/wombat/property.rb', line 3

def namespaces
  @namespaces
end

#resultObject

Returns the value of attribute result.



3
4
5
# File 'lib/wombat/property.rb', line 3

def result
  @result
end

#selectorObject

Returns the value of attribute selector.



3
4
5
# File 'lib/wombat/property.rb', line 3

def selector
  @selector
end

Instance Method Details

#flatten(depth = nil) ⇒ Object



13
14
15
# File 'lib/wombat/property.rb', line 13

def flatten(depth = nil)
  depth ? result[depth] : result
end

#resetObject



17
18
19
# File 'lib/wombat/property.rb', line 17

def reset
  self.result = nil
end