Class: React::Component::Styles

Inherits:
Object
  • Object
show all
Defined in:
lib/react/component/styles.rb

Instance Method Summary collapse

Constructor Details

#initialize(native) ⇒ Styles

Returns a new instance of Styles.



4
5
6
# File 'lib/react/component/styles.rb', line 4

def initialize(native)
  @native = native
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(prop, *args, &block) ⇒ Object



8
9
10
11
12
13
# File 'lib/react/component/styles.rb', line 8

def method_missing(prop, *args, &block)
  %x{
    if (typeof #@native[prop] === 'undefined') { return #{nil}; }
    return #@native[prop];
  }
end

Instance Method Details

#to_nObject



15
16
17
# File 'lib/react/component/styles.rb', line 15

def to_n
  @native
end