Class: Ringo::Property

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, value) ⇒ Property

Returns a new instance of Property.



10
11
12
13
# File 'lib/ringo/property.rb', line 10

def initialize name, value
  @name = name
  @value = value
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



8
9
10
# File 'lib/ringo/property.rb', line 8

def name
  @name
end

#valueObject (readonly)

Returns the value of attribute value.



8
9
10
# File 'lib/ringo/property.rb', line 8

def value
  @value
end

Class Method Details

.from_result(node) ⇒ Object



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

def self.from_result node
  Property.new node.at_css('name').text,
               node.at_css('value').text
end