Class: Rosetta::Element

Inherits:
Object
  • Object
show all
Defined in:
lib/rosetta/element.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(object) ⇒ Element

Returns a new instance of Element.



5
6
7
# File 'lib/rosetta/element.rb', line 5

def initialize(object)
  @object = object
end

Instance Attribute Details

#objectObject (readonly)

Returns the value of attribute object.



3
4
5
# File 'lib/rosetta/element.rb', line 3

def object
  @object
end

Instance Method Details

#[](key) ⇒ Object



13
14
15
# File 'lib/rosetta/element.rb', line 13

def [](key)
  object.dig(*key.split("."))
end

#propertiesObject



9
10
11
# File 'lib/rosetta/element.rb', line 9

def properties
  properties_of(object)
end